BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Connection issues with Arduino MEGA via usb to Local Server on Raspberry Pi


#1

Hi,

I tried the hole day to set up an raspberry Pi zero w as local server. This works so far. The next step should be a usb-connection from the Raspberry to my Arduino MEGA.

Everything works when i use the BLYNK Cloud.
Here the answer from the command window of the Raspberry while starting the USB Connection to Blynk Cloud.

pi@raspberrypi:~/Documents/Arduino/libaries/Blynk/scripts $ bash blynk-ser.sh
Resetting device /dev/ttyACM0…
[ Press Ctrl+C to exit ]
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> openssl-connect:blynk-cloud.com:8441,cafile=/home/pi/Documents/Arduino/libaries/Blynk/scripts/certs/server.crt,nodelay
2019/01/06 13:40:18 socat[10691] N opening character device “/dev/ttyACM0” for reading and writing
2019/01/06 13:40:18 socat[10691] N opening connection to AF=2 139.59.206.133:8441
2019/01/06 13:40:18 socat[10691] N successfully connected from local address AF=2 192.168.178.20:46082
2019/01/06 13:40:19 socat[10691] N trusting certificate, commonName matches
2019/01/06 13:40:19 socat[10691] N SSL connection using ECDHE-RSA-AES128-GCM-SHA256
2019/01/06 13:40:19 socat[10691] N SSL connection compression “none”
2019/01/06 13:40:19 socat[10691] N SSL connection expansion “none”
2019/01/06 13:40:19 socat[10691] N starting data transfer loop with FDs [5,5] and [6,6]
^C2019/01/06 13:41:41 socat[10691] N socat_signal(): handling signal 2
2019/01/06 13:41:41 socat[10691] N exiting on signal 2
2019/01/06 13:41:41 socat[10691] N socat_signal(): finishing signal 2
2019/01/06 13:41:41 socat[10691] N exit(130)
Exited!

When i start the Local Server on my Raspberry und put the USB Connection to my Windows Computer and adress in the Blynk-ser.bat to the Local Server also everything works.

My configuration of Blynk-ser.bat

set COMM_PORT=COM3
set COMM_BAUD=9600
set SERV_ADDR=192.168.178.20
set SERV_PORT=8080

At the last step ich need for my Projekt the Arduino connectet via usb to the Raspberry. because i want to use it in my Car.

My configuration of Blynk-ser.sh:

COMM_BAUD=9600
SERV_ADDR=192.168.178.20
SERV_PORT_SSL=8440
SERV_PORT_TCP=80
SERV_PORT_2WAY=8440
LSTN_PORT=80

I think i did some wrong configurations in the Blynk-ser.sh. At least the answer from the command window while trying to connect Arduino Mega via USB to Raspberry with local server:

pi@raspberrypi:~/Documents/Arduino/libaries/Blynk/scripts $ bash blynk-ser-local.sh
Resetting device /dev/ttyACM0…
[ Press Ctrl+C to exit ]
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> openssl-connect:192.168.178.20:8440,cafile=/home/pi/Documents/Arduino/libaries/Blynk/scripts/certs/server.crt,nodelay
2019/01/06 13:56:33 socat[17579] N opening character device “/dev/ttyACM0” for reading and writing
2019/01/06 13:56:33 socat[17579] N opening connection to AF=2 192.168.178.20:8440
2019/01/06 13:56:33 socat[17579] N successfully connected from local address AF=2 192.168.178.20:39852
2019/01/06 13:56:43 socat[17579] E SSL_connect(): Success
2019/01/06 13:56:43 socat[17579] N exit(1)
Reconnecting in 3s…
^CExited!

Can some one Help me? I have not so much experience with connection stuff.

And sorry for my english :wink: