Serial problem on Boron

boron
Tags: #<Tag:0x00007fe21f29e4c0>

#1

I observe a problem with a Boron which I don’t understand and I wanted to check whether someone else had the same/a similar issue.

My intention is to interface a Boron directly with a Xenon via their Serial1 ports. You may ask why, because they could communicate via the cloud or via mesh, but hear me out, please. In my use case, the Xenon is part of a mesh network for home automation/security. The mesh itself is connected via a Xenon gateway (using ethernet) to my ADSL ISP and hosts a user interface and status dashboard via the Blynk platform. As a sort of backup solution, e.g. when my regular DSL is down for some reason, I would like to add a Boron, which, via its cellular connection and another Blynk dashboard, would give me remote access to my system. Since multiple gateways are not (yet) possible, my workaround is such that the Boron provides my user interface and sends commands via the serial connection to the mesh-connected Xenon which then forwards the appropriate command within the mesh.

Now the problem: I have the two devices connected to one another by crossing over the TX and RX pins (TX Xenon to RX Boron and TX Boron to RX Xenon), both have a common ground connection, both have their battery connected and charged, the Boron is also charging via the USB port.

If I only connect the TX Boron to RX Xenon, i.e. a one-way communication from the Boron to the Xenon, the system works, i.e. the Mesh receives input via Blynk running on the Boron. However, as soon as I connect the TX Xenon to the RX Boron (in order to receive also status information from the Mesh), the Boron gives me a red SOS flashing pattern followed by 1 flash indicating “Hard fault” (whatever that means) which is followed, after a couple of seconds, by a restart. The restart seems to execute correct but after a short moment the SOS flashing pattern returns and the cylce s (and this cycle continues endlessly).

Any idea what could be the problem here? Is it just a faulty RX pin on the Boron?


#2

Can you provide a minimal test project that exherts that issue (both sides Boron & Xenon)?

In addition, have you considered using the Boron in the Ethernet FeatherWing and only switch over to Cellular when the Ethernet connection goes down?

BTW, have you also got common GND between your Boron & Xenon?

When I try this (properly wired) it works as expected

void setup() {
    pinMode(D7, OUTPUT);
    Serial.begin();
    Serial1.begin(115200);
}

void loop() {
#if (PLATFORM_ID == PLATFORM_XENON)
  while(Serial1.available()) {
      Serial.write(Serial1.read());
  }
  while(Serial.available()) {
      Serial1.write(Serial.read());
      digitalWrite(D7, !digitalRead(D7));
  }
#elif (PLATFORM_ID == PLATFORM_BORON)
  while(Serial1.available()) {
      Serial1.write(Serial1.read());
      digitalWrite(D7, !digitalRead(D7));
  }
#endif
}

When you connect the Xenon via USB and send a byte to it, it will in turn forward it to the Boron, which then mirrors it back to the Xenon which then sends it back to the host computer.


#3

Sorry, ScruffR, I had forgotten to thank you for your feedback. I had verified my setup in the meantime with by connecting the Xenon directly via Serial to an Argon. These two devices successfully communicate, so it seems that there is definitely something wrong on the hardware side with the Boron’s Serial1 port. Anyway, I have now changed my whole setup such that I will not require the Boron (while it still remains the mesh gateway) to interface via a serial port.
BTW: your idea with the Ethernet switching to the cellular connection (or to WIFI on another hotspot) is definitely a good idea. Thanks!