We are working on a project where we are using Atlas Scientific sensors like a PH-sensor, etc. We saw in this thread that it is possible to do this by connecting a ESP32 ( for example or Arduino) to the Raspberry Pi by USB and then using the VirtualHere extension on BlueOS to get the data from the sensors. I have installed the VirtualHere extension on BlueOS but I’m not sure how to use it since I have never used it or done something like this. I have also installed VirtualHere on my laptop but when I connect the ESP32 via USB to the RPi and start the VirtualHere on my laptop I don’t see anything happening? Any help would be greatly appreciated!
Hi @MartinFaak -
It sounds like you’re almost setup! The missing piece is code running on your ESP32/Arduino that receives data from connected sensors, and sends it out over the USB Serial connection. This guide may be helpful in understanding related considerations.
With the connections you’ve made thus far, your laptop should see a communications port in device manager that corresponds to the hardware plugged in to the Raspberry Pi. Have you selected that device in the VirtualHere client interface?
Are you using BlueOS? It may also be possible to read your connected sensors directly with a connection to the Raspberry Pi and the NodeRed extension…
My message wasn’t clear, the code part wasn’t the issue. The issue was that when I installed VirtualHere on the RPi and my laptop, it wouldn’t recognize the USB connection in device manager. But I’ve since gotten it to work so it’s all good now! Thanks for the help anyway!
I’m trying to do the same work but I have a similar problem: if I connect my Arduino MKR1310 to the RPi serial port (I’m using the BlueOS), the OS didn’t create the ttyACM0 file and I can’t communicate with the Arduino.
Can I ask you how did you solve the problem?
Hi @Miklux
How did you look for the port? It may be a /dev/ttyUSB#. If using the BlueOS terminal don’t forget to take the red-pill (see instructions at top)! Finally this thread and this guide may be helpful.
thank you so much for your quick reply!
I try now your suggestion, I just need to receive the serial streaming from the Arduino MKR1310 (a json format string) and put into a local file.
When i connect the usb port to one of the 4 usb ports of the RPi i don’t find the ttyUSB file, but I’m not using the “red-pill” ! Now I try with the red-pill and give you feedback
I tried to enable the red-pill but I still don’t see ttyUSBx or ttyACMx when I connect the usb cable of my Arduino MKR1310. I followed the guide in the link you sent me, but when I type “ls /dev/serial/by-id” I get an error because the serial folder doesn’t exist.
I don’t understand where the problem is…
If i write the command linels /dev/serial/tty* i receive the error “No such file or directory”.
The tty* files in the attached image are inside the dev directory
Hi @Miklux -
My apologies I was mistaken - the /serial is included erroneously.
Compare the output of the ls command in that directory with and without your device plugged in. You could also observe the most recent output of dmesg after plugging your device in.
Hi @tony-white
thank you for your kindly answer
I try to plug and unplug the Arduino to the RPi thinking to see about some changes in the list of devices but nothin appens. When i take a look to the output of dmesg I see this:
As you can see, it seems to be connect and immediately disconnect the device ( ttyACM0) infact after do that the ttyACM0 doesn’t appear in the dev directory.
In windows the Arduino is working correctly and is communicating the data via the serial usb.
Do you think there is some kind of problem in my BlueOS ?
Thank you again for your kindly attention,
Mik
Could this be a hardware issue with the RPi or cable? Can you pull the SD card and try it in another RPi with the 1310? Make sure power supply is adequate if on the bench. Disconnect ROV battery power to RPi, then reconnect. Are you using the same USB cable when plugging the Arduino into the PC? We have done this very thing, using a MKR1310 connected to an RPi 4, with no problem. Then displayed LoRA radio-received data in Node-Red. Super cool.
I am using the SD Card with BlueOS purchased with the BlueBoat.
I use the same USB cable both to connect the MKR1310 to the RPi and to the PC.
On the PC that runs Windows everything is fine, but when I connect it to the RPi I cannot establish a serial communication via USB with the MKR1310.
I noticed that if I try to connect an Arduino Nano instead something changes.
For example, if I use VirtualHere with the MKR1310 I cannot establish any connection with the client while with the Arduino Nano I can.
I don’t think there are any power supply problems.
I thought it could be some compatibility problem with the serial communication chip of the MKR1310, but if you managed to make it work then the problem is another.
I could try with another MKR1310 or a MKR1000 to see if anything changes.
Do you have any other ideas?
Thanks in advance,
Mik
@Miklux Have you tried it with no peripherals attached? just the plain MKR1310 board, maybe running a “blink” sketch or something else simple, to rule out some of the integrations or sensors interfering.
Hi @Miklux -
Try a different USB cable! It’s possible your PC USB port is getting a better connection than the Raspberry Pi? Have you tried all 4 ports on the Pi?
Hi @williangalvani ,
yes I’ve tried also with no peripherals attached and the results are the same.
Some day ago I attached an Arduino Nano and with it is possible to use the Virtualhere extension without problems.
Maybe it’s possible some kind of problem with the Arduino MKR 1310 USB chipset ?
Hi @tony-white ,
i tried also the 4 different USB available in the RPi but with the Arduino MKR 1310, have the same results.
Now I’m working with an Arduino Nano attached to the USB port and with it I have no problems… it’s very strange i think…
Maybe somkind problem with the recognition of the USB chipset mounted on the Arduino MKR?
I would like to use Arduino MKR 1310 to exploit, when necessary, the LoRA protocol and the ultra low energy capability of the SAMD21 but with this communication problem I can’t
Hi @Miklux -
Since the Nano works, and Chris has used a MKR 1310 without issue, I would suspect the issue is particular to your hardware setup and not related to software.
Trying a different USB cable or MKR 1310, and checking the 5V rail with a multimeter may help explain things - maybe the MKR 1310 isn’t getting enough voltage?