2

I have a Raspberry Pi 4 with Buster and on top of it a 4G HAT.

This HAT allows communicating via RX and TX pins.

I want to communicate with this HAT via RX and TX pins but with an Arduino Nano. It works when Arduino and the 4G HAT are connected without the Raspi4.

The problem is that when I connect everything (Raspi4, 4G HAT on top of it and Arduino), the communication between Arduino and the 4G HAT is lost because both (from Raspi and Arduino) serial ports "collide".

How do I permanently deactivate RX and TX serial communication from Raspberry? I tried to disable Serial with raspi-config but it does not work (e.g. GPIO15 is still high)

Miguel
  • 233
  • 1
  • 10
  • (1) A quick and dirty work around is using a HAT pin adapter and cut/divert/rewire the TxD and RxD pins away from Rpi and instead to Arudino: https://raspberrypi.stackexchange.com/questions/104705/how-to-tap-tee-fork-the-rpi-gpio-pins-covered-blocked-by-a-hat-phat-bo. (2) If you collide/short/crash/connect 4G HAT's 3V3 TxD and RxD pins to Arduino's 5V TxD and RxD pins, your Rpi TxD and RxD pins might latch up sooner or later melt down or blow up. – tlfong01 Mar 27 '20 at 04:58
  • And if you are using the SixFab 4G HAT, you can choose the "no header" option and DIY your own customized stackable 40 pin header. I am using the WaveShare SIM7600 4G HAT without the "no header" option and need to use other workarounds. – tlfong01 Mar 27 '20 at 05:10
  • 1
    Ok, thanks. Yes, it's the SixFab. I think I'll cut. It's the simplest solution. I also have WaveShare SIM7600. The problem with it is that I want to use the sleep function. When I send the AT command to sleep (AT+QSCLK=1) SIM7600 does sleep (right after the command). But when I poweroff Raspi4, it leaves sleep state... – Miguel Mar 27 '20 at 09:59
  • I don't know "AT+QSCLK=1". Which AT command manual are you using? Mine is "SIM7500_SIM7600 Series_AT Command Manual _V1.07" – tlfong01 Mar 27 '20 at 13:34
  • 1
    [This one.](https://sixfab.com/wp-content/uploads/2018/09/Quectel_EC25EC21_AT_Commands_Manual_V1.2.pdf) – Miguel Mar 28 '20 at 00:20
  • Thank you very much. So it is this manual: "QuecTel EC25/EC21 LET Module AT Commands Manual V1.2 2017nov14 - SixFab": https://sixfab.com/wp-content/uploads/2018/09/Quectel_EC25EC21_AT_Commands_Manual_V1.2.pdf. Let me see check out why "AT+QSCLK+1" does not work. Cheers. – tlfong01 Mar 28 '20 at 04:19
  • I checked the "AT+QSCLK" command and fount that you need DTR to do the job. I guess you have not connected Rpi's DTR pin to the QuesTel LTE module. – tlfong01 Mar 28 '20 at 04:33
  • QuecTel LTE can talk through ttyUSBx or ttySx ports. Even if you are using the 5 ttyUSB0~4 ports to communicate, you still need to connect the DTR wires, among 5 other wires. See my answer to your earlier question: https://penzu.com/public/9fb61b9c. Cheers. For WaveShare LTE, the serial hardware interface is simple, no DTR is required, therefore no "AT+QSCLK" commands. – tlfong01 Mar 28 '20 at 04:54
  • That said, WaveShare SIM7600G does use RING signal to wake up sleeping Rpi4B: penzu link: https://penzu.com/p/b8fe26ad. – tlfong01 Mar 28 '20 at 05:43

1 Answers1

3

The 4G HAT presumably uses the serial port for a reason.

Serial is point to point protocol, so only 2 devices can be used.

If you want to use Arduino don't use the Pi or vice versa.

Your question is somewhat unclear, but the Pi4 has 4 additional UART which can be used. See https://raspberrypi.stackexchange.com/a/107780/8697

It is simple to disable the Pi serial - Pins 14/15 will then be configured as inputs, so should have no impact.

NOTE most Arduino have 5V I/O so need level converters to connect to the Pi.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • The 4G HAT I'm using (SixFab) does not use TX and RX pins to communicate with the Raspberry. And I want to use these pints to communicate with the 4G HAT using and Arduino. – Miguel Mar 27 '20 at 10:03