Cannot connect to TWS using IBrokers with R - interactive-brokers

library(IBrokers)
tws <- twsConnect(port=7496)
Error in socketConnection(host = host, port = port, open = "ab", blocking = blocking) :
cannot open the connection
In addition: Warning message:
In socketConnection(host = host, port = port, open = "ab", blocking = blocking) :
localhost:7496 cannot be opened
I have checked my Global Configurations in the TWS. The port is in fact 7496.
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 20
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] IBrokers_0.9-12 xts_0.12-0 zoo_1.8-8
loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3 grid_3.6.3 lattice_0.20-40
I am using the latest of Linux Mint. My IB account has been approved and funded.

Related

Arangodb container reaches memory limit and crashes while filtering using 'path' for graph traversal

My Environment
ArangoDB Version: 3.6.2
Storage Engine: RocksDB
Deployment Mode: Single Server
Deployment Strategy: Manual Start in Docker
Infrastructure: Own
Operating System: Linux version 4.4.0-154-generic (gcc version 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) )
Total RAM in your machine: 4GB
Disks in use: HDD
Used Package: Docker-Official Docker library
My Problem:
I have a graph with 60k nodes and 4*60k edges. Whenever I try using 'path' for Filter or Return, the memory limit reaches, arangodb container crashes and it gets restarted. However, if I don't use 'path' and use 'vertex' or 'edge' only for filter or return the query executes and produces result as expected. This issue is seen in version 3.6.2.
However, in arangodb 3.1.18 this issue is not seen and everything is
working fine.
Sample Query:
FOR v, e, p IN 6 OUTBOUND "root_node" GRAPH "my_graph_db"
FILTER (
LENGTH(p.edges) == 6 &&
LIKE (p.edges[3]._from,"Data_level_3%",true) &&
(LIKE (p.edges[3]._to, "Data_level_4%") || LIKE (p.edges[3]._to, "Data_4%")) &&
...................................................................
)
LIMIT 0,10
RETURN {
result: Merge(
{data: v},
{parent_id: p.edge[5]._id}
),
.................
}
Expected result:
The arangodb container should not reach memory limit crash. 'Path' attributes needs to accessed while doing queries.
Please refer to https://github.com/arangodb/arangodb/issues/11277

Intel Edison + Ubilinux + USB to UART = USB Device not created

Dear community members,
We are working in the development of a robot autonomous control system running inside an Intel Edison, which -in turn- runs in a PixHawk automatic pilot module . This system uses ROS (Robot Operating System) and therefore we had to install Ubilinux. Our system requires being connected with a 360-degree laser (RPLIDAR-360) that sends data through a serial channel, so we are trying to get laser's data through USB-to-UART adapter (Silicon lab's CP2102) (the PixHawk only has a USB available for data transfer).
In summary, the laser is connected to the USB2UART adapter, and the adapter is connected to Edison's serial port.
However, we are stuck with some kind of driver issue. When tracing 'dmesg' the device is detected (idVendor=10c4, idProduct=ea60):
[ 917.812195] usb usb2: Product: xHCI Host Controller
[ 917.812214] usb usb2: Manufacturer: Linux 3.10.17-yocto-standard-r2 dwc-xhci
[ 917.812232] usb usb2: SerialNumber: dwc3-host.2
[ 917.812858] xHCI xhci_add_endpoint called for root hub
[ 917.812878] xHCI xhci_check_bandwidth called for root hub
[ 917.813141] hub 2-0:1.0: USB hub found
[ 917.813185] hub 2-0:1.0: 1 port detected
[ 918.128982] usb 1-1: new full-speed USB device number 2 using dwc3-host
[ 918.151786] usb 1-1: New USB device found, idVendor=10c4, idProduct=ea60
[ 918.151818] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 918.151839] usb 1-1: Product: CP2102 USB to UART Bridge Controller
[ 918.151857] usb 1-1: Manufacturer: Silicon Labs
[ 918.151875] usb 1-1: SerialNumber: 0001
With the following details:
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=10c4 ProdID=ea60 Rev= 1.00
S: Manufacturer=Silicon Labs
S: Product=CP2102 USB to UART Bridge Controller
S: SerialNumber=0001
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
But no /dev/ttyUSBX device is created, and there are no error messages about missing Drivers or configuration failures.
We are using Ubilinux 3, which reports the following with the 'uname' command:
** 3.10.17-yocto-standard-r2
And the following is the listing of the installed drivers:
usb
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/media/usb:
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/media/usb/gspca:
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/media/usb/uvc:
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/usb:
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/usb/gadget:
usb_f_acm.ko
/lib/modules/3.10.17-yocto-standard-r2/kernel/drivers/usb/serial:
usb_wwan.ko
Does anyone has had a similar configuration and managed to make work a CP2102 adapter?
As a last resort, we are trying to compile and install the driver by ourselves, using this reference: [url=https://askubuntu.com/questions/941594/installing-cp210x-driver]Installing CP210x Driver?Installing CP210x Driver? - Ask Ubuntu[/url]
The 'make' process crashes due to a lack of headers. We were unable to download the headers through APT, but at the end, we managed to compile the '.ko' module by downloading the headers manually from a Website.
However, after doing:
insmod cp210x.ko
We got:
Insmod: ERROR: could not insert module cp210x.ko: Invalid module format
So, at this point we have several questions... any advice about any of them would be really appreciated:
Does anybody know how to install the Kernel headers in Ubilinux - 3.10.17?
What is the official procedure to upgrade the Kernel in Ubilinux?, we already have ROS working on the board... do you think a kernel upgrade could mess our ROS configuration?
In general, do you have any successful experience in the configuration of a cp210x device?
Thanks in advance,
Héctor
The driver for cp2102 already exist in kernel, no need of extra efforts. Just use the correct udev rule file (not present by default in linux distro). An example is here. With this file /dev/ttyUSBX will be created.

caffe powered and GPU enabled Microsoft Azure VM

I'm trying to build a VM for model training in Azure. I found this Data Science Virtual Machine for Linux (Ubuntu) VM which seems to be a suitable candidate.
Unfortunately, when I spun up the VM and installed the caffe prerequisites I wasn't able to run the tests. I'm getting the following error on make runtest (make all and make test were completed without errors):
NVIDIA: no NVIDIA devices found
Cuda number of devices: 0
Setting to use device 0
Current device id: 0
Current device name:
Note: Randomizing tests' orders with a seed of 97204 .
[==========] Running 2041 tests from 267 test cases.
[----------] Global test environment set-up.
[----------] 11 tests from AdaDeltaSolverTest/3, where TypeParam = caffe::GPUDevice<double>
[ RUN ] AdaDeltaSolverTest/3.TestAdaDeltaLeastSquaresUpdateWithHalfMomentum
NVIDIA: no NVIDIA devices found
E0715 02:24:32.097311 59355 common.cpp:114] Cannot create Cublas handle. Cublas won't be available.
NVIDIA: no NVIDIA devices found
E0715 02:24:32.103780 59355 common.cpp:121] Cannot create Curand generator. Curand won't be available.
F0715 02:24:32.103914 59355 test_gradient_based_solver.cpp:80] Check failed: error == cudaSuccess (30 vs. 0) unknown error
*** Check failure stack trace: ***
# 0x7f77a463f5cd google::LogMessage::Fail()
# 0x7f77a4641433 google::LogMessage::SendToLog()
# 0x7f77a463f15b google::LogMessage::Flush()
# 0x7f77a4641e1e google::LogMessageFatal::~LogMessageFatal()
# 0x7115e3 caffe::GradientBasedSolverTest<>::TestLeastSquaresUpdate()
# 0x7122af caffe::AdaDeltaSolverTest_TestAdaDeltaLeastSquaresUpdateWithHalfMomentum_Test<>::TestBody()
# 0x8e6023 testing::internal::HandleExceptionsInMethodIfSupported<>()
# 0x8df63a testing::Test::Run()
# 0x8df788 testing::TestInfo::Run()
# 0x8df865 testing::TestCase::Run()
# 0x8e0b3f testing::internal::UnitTestImpl::RunAllTests()
# 0x8e0e63 testing::UnitTest::Run()
# 0x466ecd main
# 0x7f77a111c830 __libc_start_main
# 0x46e589 _start
# (nil) (unknown)
Makefile:532: recipe for target 'runtest' failed
make: *** [runtest] Aborted (core dumped)
Is it possible to spin up a virtual machine in Azure suitable for GPU enabled machine learning using caffe?
All the details about the VM here
The Data Science Virtual Machine (DSVM) for Ubuntu already has Caffe installed in /opt/caffe. To use it on a GPU, create a VM with a K80 GPU by choosing the one of the NC sizes. (Be sure to choose HDD as the storage type, or the NC sizes will not appear.) Caffe will then be available out of the box.
Also note that PyCaffe is available. At a terminal:
source activate root
And python will then have PyCaffe available.

Change character set on Microsoft R Server 9.0.1

Q: How to you change/update the character set on Microsoft R Server?
Issue: I am trying to read a CSV that is delimited with '§' but the R Server is not able to interperet the '§' character when I work remotely. Similarly for other characters like 'ø' , 'æ' and 'å'. When I work locally it's not an issue.
For example:
This works fine:
> x <- '§'
> x
[1] "§"
But when i login remotely to the server the following happens:
REMOTE> x <- '§'
REMOTE> x
[1] "?"
Setup: I am running Microsoft R Server 9.0.1 on Windows Server 2012 R2
Detailed sessionInfo:
REMOTE> sessionInfo() R version 3.3.2 (2016-10-31) Platform:
x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server >= 2012
x64 (build 9200)
locale: [1] LC_COLLATE=Norwegian (Bokm�l)_Norway.1252 [2]
LC_CTYPE=Norwegian (Bokm�l)_Norway.1252 [3] LC_MONETARY=Norwegian
(Bokm�l)_Norway.1252 [4] LC_NUMERIC=C
[5] LC_TIME=Norwegian (Bokm�l)_Norway.1252
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] RevoUtilsMath_10.0.0 RevoUtils_10.0.2
RevoMods_10.0.0 [4] RevoScaleR_9.0.1 lattice_0.20-34
rpart_4.1-10
loaded via a namespace (and not attached): [1] R6_2.2.0
tools_3.3.2 CompatibilityAPI_1.1.0 [4] codetools_0.2-15
grid_3.3.2 iterators_1.0.8 [7] foreach_1.4.3
mrupdate_1.0.0 jsonlite_1.1
In addition to installing version 9.1 of Microsoft R Server I also had to make the following change for the server to work correctly with remote login:
Stop the service 'RServe9.0.0.0'
and go to C:\Program Files\Microsoft\R Server\R_SERVER\o16n\RServe\RScripts\source.R on the compute nodes
and change
```
#add more here if necessary......
```
to
```
#add more here if necessary......
options(encoding = "UTF-8")
```
and then start that service again, you should be able to use §.
Thanks to Microsoft for providing this fix.
This is a known bug, and has been patched in Microsoft R Server 9.1, please upgrade to solve your issue.

RNeo4j errors: Could not resolve host: http when issue graph = startGraph("http:/localhost:7474/db/data") in RStudio

When I tried to call RNeo4j's startGraph, it keeps giving me the error Could not resolve host: http. I verified the neo4j server is working, and browsers from both local and remote hosts returns correct answers, but not from the RStudio. I've tried R 3.1.2 and R 3.1.0. Both gave the same response. The sessionInfo() shows the necessary libraries are loaded:
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RJSONIO_1.3-0 RNeo4j_1.0 rJava_0.9-6 RCurl_1.95-4.5
[5] rjson_0.2.15 bitops_1.0-6
loaded via a namespace (and not attached):
[1] codetools_0.2-8 devtools_1.6.1 httr_0.6.1 igraph_0.7.1
[5] pryr_0.1 Rcpp_0.11.3 stringr_0.6.2 tools_3.1.0
> graph = startGraph("http:/localhost:7474/db/data")
Error in function (type, msg, asError = TRUE) :
Could not resolve host: http
>
Make sure you include the trailing forward slash and use http://:
graph = startGraph("http://localhost:7474/db/data/")
Let me know if that works.

Resources