Serial Communication Sodaq ONE

I would like to receive data throughout Serial Communication. I am adding the following code using a Sodaq ONE board:

void setup() {
// put your setup code here, to run once:

Serial.begin(19200);

}

void loop() {
// put your main code here, to run repeatedly:

}

I plugged in the cables into RX-TX communication, but nothing appears on the screen. Is anything I missed there?

Many Thanks

In setup() you are starting the Serial device at 19200. However, you are not doing anything with that device. You need to read the data from the Serial stream and process it or forward it to another stream if required.

For example here is passthrough sketch connecting Serial to SerialUSB:

void setup() {
  Serial.begin(57600);
}

void loop() { 
  if (Serial.available()) {
    SerialUSB.write(Serial.read());
  }
  if (SerialUSB.available()) {
    Serial.write(SerialUSB.read());
  }
}

Note that on the SodaqOne the_SerialUSB_ is the connection to the host PC / Machine over USB. Serial is available on D12/D13 [edited] and Serial1 connects to the LoRa module.

The goal consists basically within connect a controller (from air cond. trains) to Sodaq ONE board and, then be able to see data via Arduino IDE serial console.
So, as the controller doesn’t have any USB connection chance, it is thought to use a RS232 connector from the controller and plug it into a MAXRS232 converter. So, Sodaq ONE will be connected to the converter via the pins you mention above (D0/D1).
So, in this case, MAXRS232 will be able to convert signals from a TIA-232 (RS-232) serial port to signals suitable for use in TTL-compatible digital logic circuits.

May I be able to develop it properly with the code you posted above as well as the pins (D0/D1)?
Please, correct me anything I missed.

Many Thanks

Here you have the controller connection:

which is going to be connected to MAXRS3232 converter, in order to be plugged into the Sodaq one, as the following picture:

But nothing comes up into the Arduino Serial console…

Yes you should be able to use the pass through sketch for your setup.

Just check a few things first:

  • You should power that breakout board from the 3.3V supply.
  • Make sure the output logic levels in use are 3.3V compatible.
  • Ensure that you open the Serial connection (see setup()) at the correct baud rate.
  • The Tx/Rx pins are meant to be crossed over eg. for devices A and B: RxA -> TxB and TxA -> RxB. Also note that sometimes the labelling is incorrect.

Everything is double checked. We should see data from the controller into the Serial console, but nothing happens…

  • Pins on the RS3232 connectors are tested with the right Voltage.

  • Breakout board is powered from the 3.3V Sodaq pin.

  • Tx-Rx pins are double checked.

  • Baudrate is indicated either code as well as console.

I am using the code you posted above:

void setup() {
  Serial.begin(19200);
}
void loop() { 
  if (Serial.available()) {
SerialUSB.write(Serial.read());
  }
  if (SerialUSB.available()) {
Serial.write(SerialUSB.read());
  }
}

Sorry, I got the pins confused. See the pins labelled D12/D13 here:
http://support.sodaq.com/sodaq-one/sodaq-one/

Not worries…Even using D12-TX and D13-Rx it is not sending data yet…
Do you think should come up the controller data into the serial console as we have configured it?

Hi Toni,

Serial communication can operate with a range of parameters (e.g. number of databits, stopbits etc). The Arduino libraries assume a specific setup by default. I may need to see some documentation on the output of your device to see the format of the data it is sending.

Do you have a second Arduino or Sodaq board? We could try first sending serial data between them to check that it is setup correctly before trying tor read the data stream from your other device.

Hi Gabriel,
Could you please provide me a mail in order to send you our Liebherr Controller Manual (It is in Dutch and just 9 pages). Since I am not able to send pdf files throughout this forum…

Thanks

Hi Gabriel,

May I get a standard script to make a serial communication among those Sodaq boards (Sodaq ONE/NB-IOT), please? So that, in that case, as you said on previous response, we would be able to check first of all if serial data between them is setup correctly.