NEED HELP: arduino via serial USB over Raspberry Pi 3

hi. i have problem to connect the arduino to the blynk server via serial USB where im use the raspberry pi 3.
i have try to run ./blynk-ser.sh and i got this error:

pi@raspberrypi:~/Arduino/libraries/Blynk/scripts $ ./blynk-ser.sh
[ Press Ctrl+C to exit ]
/dev/ttyUSB0 not found.
Select serial port [ /dev/ttyACM0 ]: 
Resetting device ...
stty: hupcl: No such file or directory
Connecting: FILE:,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> openssl-connect:blynk-cloud.com:8441,cafile=/home/pi/Arduino/libraries/Blynk/scripts/certs/server.crt,nodelay
2016/10/27 12:33:16 socat[6408] N opening undef "" for reading and writing
2016/10/27 12:33:16 socat[6408] E open("", 04002, 0666): No such file or directory
2016/10/27 12:33:16 socat[6408] N exit(1)
Reconnecting in 3s...
^CExited!

so, any solution with this problem???

Figure out which serial device is your Arduino. E.g. lsusb and see where it’s attached, or check the /dev folder for an USB device before and after plugging in your Arduino

my arduino mega is on port /dev/ttyACM0

i hv try this just now:
sudo ./blynk-ser.sh -c /dev/ttyACM0 -b 9600 -s cloud.blynk.cc -p 8442

but its stuck at opening connection … 5 minute later still stuck at there

pi@raspberrypi:~/Arduino/libraries/Blynk/scripts $ sudo ./blynk-ser.sh -c /dev/ttyACM0 -b 9600 -s cloud.blynk.cc -p 8442
[ Press Ctrl+C to exit ]
Resetting device /dev/ttyACM0...
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> openssl-connect:cloud.blynk.cc:8442,cafile=/home/pi/Arduino/libraries/Blynk/scripts/certs/server.crt,nodelay
2016/10/27 12:41:31 socat[6675] N opening character device "/dev/ttyACM0" for reading and writing
2016/10/27 12:41:32 socat[6675] N opening connection to AF=2 45.55.195.102:8442

@alexanderisz not sure where you are getting your information from but it is out of date.

https://github.com/blynkkk/blynk-library/wiki/USB-Serial shows the existing server not the server that was retired over 6 months ago.

sudo ./blynk-ser.sh -c /dev/ttyACM0 -b 9600 -s blynk-cloud.com -p 8442

thanks for that information…

so, i hv try this and its always reconnecting… any solution?

pi@raspberrypi:~/Arduino/libraries/Blynk/scripts $ ./blynk-ser.sh -c /dev/ttyACM0 -b 9600 -s blynk-cloud.com -p 8442
[ Press Ctrl+C to exit ]
Resetting device /dev/ttyACM0...
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> openssl-connect:blynk-cloud.com:8442,cafile=/home/pi/Arduino/libraries/Blynk/scripts/certs/server.crt,nodelay
2016/10/27 12:50:41 socat[6820] N opening character device "/dev/ttyACM0" for reading and writing
2016/10/27 12:50:42 socat[6820] N opening connection to AF=2 188.166.177.186:8442
2016/10/27 12:50:42 socat[6820] N successfully connected from local address AF=2 192.168.1.6:45160
2016/10/27 12:50:43 socat[6820] E SSL_connect(): socket closed by peer
2016/10/27 12:50:43 socat[6820] N exit(1)
Reconnecting in 3s...

Did you put in the correct auth token?

yes… ihv put correct token.

You probably need to use TCP instead of SSL, to see if the problem is in there. Edit the blynk-ser.sh file and change:

TO_TYPE="SSL" # TCP, SSL

to:

TO_TYPE="TCP" # TCP, SSL

And see what happens then

okay. i hv change SSL to TCP on blynk-ser.sh file. and was successfully connected. but on my blynk app said “your Arduino not in network”.

pi@raspberrypi:~/Arduino/libraries/Blynk/scripts $ ./blynk-ser.sh
[ Press Ctrl+C to exit ]
/dev/ttyUSB0 not found.
Select serial port [ /dev/ttyACM0 ]: /dev/ttyACM0
Resetting device /dev/ttyACM0...
Warning: Server connection may be insecure!
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> TCP:blynk-cloud.com:8442,nodelay
2016/10/27 13:14:54 socat[8228] N opening character device "/dev/ttyACM0" for reading and writing
2016/10/27 13:14:55 socat[8228] N opening connection to AF=2 188.166.177.186:8442
2016/10/27 13:14:55 socat[8228] N successfully connected from local address AF=2 192.168.1.6:45208
2016/10/27 13:14:55 socat[8228] N starting data transfer loop with FDs [5,5] and [6,6]

Yeah, ignore it and see if you can light a LED or switch a relay attached to a physical pin :slight_smile:

-edit

To have SSL work, you need to install the server.crt from the cloud server.

i hv attached the LED on digital pin 13 and try to control via blynk app… unfortunately the LED not responding

Hmm, bugger, I’ve got a feeling we are almost there. What sketch did you upload to the Arduino?

i use Arduino serial USB example…

And all you did was enter the Auth token? If you did it should be fine and working.

yaaa i hv enter the auth token… but didt not working… i will try it again.

finally is working !! thanks @Lichtsignaal for your helping. hv a nice day.

Yr welcome and enjoy :slight_smile:

1 Like