-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting started #2
Comments
First of all, thanks for your feedback. Now, that's an odd error that I rarely encountered before, however as I was trying to reproduce I'd like to ask you try few things:
library(rib)
wrap <- IBWrapSimple$new()
ic <- IBClient$new(wrap)
ic$connect(port=7496, clientId=1) and let me know if the error persists. |
I've tried and restarted with: (checking the port and the Enable ActiveX) TWS963 I'm using MacOS 10.14.4 I think it might be related to the Mac socket. |
Changing the endian to swap (line 72 from IBClient.R) seems to be moving forward.
Now I'm getting the following error related with the version:
TWS963 |
and after hardcode these variables: I get the initial error:
|
It might about endianess... Out of curiosity, if you don't mind, could you paste the following in a R session and txt <- as.raw(c(0,0,0,0x1a))
writeBin(10L, raw(), size=4, endian="big")
writeBin(10L, raw(), size=4, endian="little")
readBin(txt, integer(), size=4, endian="big")
readBin(txt, integer(), size=4, endian="little") Thanks |
|
Well, that's what I get. Could you try pasting this in R, while a fresh TWS is listening on 7496? port <- 7496
msg <- as.raw(c(charToRaw("API"), 0L, 0L, 0L, 0L, 10L, charToRaw("v101..151"), 0L))
msg
ss <- socketConnection(port=port, open="r+b")
writeBin(msg, ss)
Sys.sleep(2)
len <- readBin(ss, integer(), size=4, endian="big")
len
readBin(ss, raw(), n=len) |
|
Well, that looks correct: the handshake with TWS is successful. My next suspect would be |
From R terminal:
|
It is curious if I force to use R 3.3.3 (changing the DESCRIPTION file and build again the package) the error is about the object MIN_CLIENT_VER, and then MAX_CLIENT_VER, MAX_MSG_LEN, HEADER_LEN and API_SIGN.
|
I tried removing Could you try the following? remotes::install_github("lbilli/rib", "issue2")
library(rib)
ew <- IBWrapSimple$new()
ic <- IBClient$new(ew)
ic$connect(port=7496)
ic$checkMsg() |
|
That looks more like a namespace issue... maybe due to sourcing some files individually (e.g. Anyways, I think I'll have to put this on hold until I get access to a Mac myself in order to deal with it properly. |
Hi, first at all, thank so much for the package.
I'm trying to test the req/resp example and I getting an error in the connection:
I'm using TWS972.
For other hand, I'm getting the following functions' output:
The text was updated successfully, but these errors were encountered: