Arduino Boards over USB Hub on RaspB Local Server, need help with SOCAT

Hello, first of all my knowlege of programming in general is very limited so please be patient.

I did some tests with USB Connected Arduinos on OSX over Blynk Cloud, everything worked.

Now i would like to set up more than one Arduino boards which are directly connected via USB to a Raspberry B local Server.
The Raspberry was a headless setup and i installed a VNC Server which all is working fine.

I can connect via iOS Blynk App on the local server but i get the message that the “device is offline”.
When i open the Serial Monitor in the Arduino IDE i get the AuthToken repeatedly.

The sketch (used the sketchbuilder) look like this:

#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
    
#include <BlynkSimpleStream.h>
#include <DHT.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "myauthtoken";

#define DHTPIN 2          // What digital pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11     // DHT 11
#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    SwSerial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}

void setup()
{
  // Debug console
  SwSerial.begin(9600);

  // Blynk will work through Serial
  // Do not read or write this serial manually in your sketch
  Serial.begin(9600);
  Blynk.begin(Serial, auth);

  dht.begin();

  // Setup a function to be called every second
  timer.setInterval(1000L, sendSensor);
}

void loop()
{
  Blynk.run();
  timer.run();
}

i am supposed to change “Blynk.begin(Serial, auth);” to what exactly?

In the manual it says:
Change your rasp PI javascript from

...
or in case of USB when running blynk-ser.sh provide '-s' option with address of your local server

  ./blynk-ser.sh -s you_host_or_IP


pi@raspberrypi:~/Arduino/libraries/Blynk/scripts $ ./blynk-ser.sh
Warning: Server connection may be insecure!
[ Press Ctrl+C to exit ]
Connecting: TCP-LISTEN:8442,reuseaddr,fork,nodelay <-> TCP:10.0.0.5:8442,nodelay
2017/11/07 21:48:11 socat[3453] E bind(5, {AF=2 0.0.0.0:8442}, 16): Address already in use
2017/11/07 21:48:11 socat[3453] N exit(1)
Reconnecting in 3s...

when running “nano /home/pi/Arduino/libraries/Blynk/scripts/blynk-ser.sh” i get:

#!/bin/bash
# Detect script path
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd`
popd > /dev/null

# === Edit default options to match your need ===

FROM_TYPE="TCP" # SER, TCP
TO_TYPE="TCP"   # TCP, SSL

COMM_BAUD=9600
SERV_ADDR=10.0.0.5
SERV_PORT_SSL=8441
SERV_PORT_TCP=8442
SERV_PORT_2WAY=8443
LSTN_PORT=8442

SRVR_CERT="$SCRIPTPATH/certs/server.crt"

any Ideas?

My guess is that the server (or something else) is already running (on that port). Try this on your RPi:

~$ netstat -l | grep 8442

And kill whatever you find :wink: