S0PCM & LinkSprite RS485_HAT not operating on RPI_Zero2W&Buster

Moderator: leecollings

Post Reply
Toulon7559
Posts: 848
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

S0PCM & LinkSprite RS485_HAT not operating on RPI_Zero2W&Buster

Post by Toulon7559 »

After a useful life of more than 5 years it looks as if my first Raspberry (RPI-B) has succumbed:
only the red LED is on and no further signs of life. Reboot = no revival.
SD-card transferred to an RPI_Zero2W with ETH_USB_HAT, checked stand-alone => revival of software = SD-card OK.
=> back in business, now even extended with WLAN and more USB-ports.

From heritage through the SD_card_configuration, that RPI_Zero2W is operating with latest Buster-release as OS:
all circuits operating with LAN and RFXCom show reactions as before with software incl. Lua, Python and Domoticz.

Registration of Energy is a prime task of this RPI, reading the S0-interfaces and the RS485-interfaces of the set of kWh-meters
- the S0-interfaces by means of S0PCM linked to the USB-interface of the RPI
- the RS485-interfaces by means of a Linksprite RS485_HAT, as described in the Wiki

Reconnected S0PCM on an USB-port of the RPI_Zero's Hub:
should work without fuzz, but no revival in Domoticz.
Solved: see next message

Shifted the installed RS485_HAT to the RPI_Zero2W.
Because the interface to a connected BMP180 behaves OK,
sign that this 26pin LinkSprite RS485_HAT is correctly installed on the 40-pin GPIO-interface, and ETH_USB_HAT is transparant.
Except that this RS485_HAT in new configuration does not properly behave for the RS485-communication:
- no blinking LEDs for TX and RX, but only 1 red flash for RX at start and then steady green LED for TX [= impression that output to RS485-bus seems locked, and no input = no handshaking]
- checking software has initial report on the interface characteristics, but then locks,
- same for Python-scripts previously reading the RS485-communication of the kWh-meters type DDS238_1ZNs.
Configuration not very stable, with Domoticz 2022.2 dropping offline several times per day; sometimes only revival is by hard reset.

Linksprite no longer directly sells this board, nor via Sparkfun, but equivalent can still be purchased from JoyIt or Conrad.

Just puzzled whether problem is in the RPI-Zero & ETH_USB_HAT, or in the RS485_HAT on top of the ETH_USB_HAT.
2 Possible aspects:
a. Compatibility aspect of RS485_HAT vs. RPI_Zero2W & ETH_USB_HAT?
Who has info/experience?
b. (Not likely, but) simultaneous breakdown at RS485-bus?
Any hints how to check the RS485-function except by disconnection of all clients from the RS485-bus, and then step-by-step reconnection?
Last edited by Toulon7559 on Wednesday 18 January 2023 10:21, edited 6 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 848
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: S0PCM & LinkSprite RS485_HAT not operating on RPI_Zero2W&Buster

Post by Toulon7559 »

Because the RS485-interface makes use of tty/UART, might it be that in the transition from RPI_B to RPI-Zero an error has 'developed', killing the interfaces?

Extract from the UserGuide for LinkSprite RS485_HAT
Spoiler: show
$ sudo apt-get update

2 . Install python-pip

$ sudo apt-get install python-pip
3.Use pip to install WiringPi (WiringPi is designed for raspberry pi to behave similarly to that of the wiring library under Arduino.
After this library is installed,c or shell or python can use the function to configure and control GPIOs directly. :

$ sudo pip install wiringpi

4. Installed the associated library files of serial ports :

$ sudo apt-get install python-serial

5.Test whether the GPIO library and the serial library is installed or not:

$ python

$ import RPi.GPIO

$ import serial

If there is no error, then the two libraries are installed correctly.

6. We need to configure file ‘/boot/cmdline.txt’ to remove the kernel booting information and debug message:

$ sudo nano / boot / cmdline.txt

You can see the following information:

dwc_otg.lpm_enable = 0 console = ttyAMA0, 115200 kgdboc = ttyAMA0, 115200 console = tty1 root = / dev/mmcblk0p2 rootfstype = ext4 elevator = deadline rootwait

Remove “console = ttyAMA0, 115200 kgdboc = ttyAMA0, 115200” so that the information becomes:

dwc_otg.lpm_enable = 0 console = tty1 root = / dev/mmcblk0p2 rootfstype = ext4 elevator = deadline rootwait

7. Disable log in from the serial port:

$ sudo nano / etc / inittab

and comment out ” T0: 23: respawn :/ sbin / getty-L ​​ttyAMA0 115200 vt100″

8 Restart Raspberry Pi:

$ sudo reboot

Now you can use / dev/ttyAMA0 like the regular COM port.
For WiringPi several versions exist.
Probably from past in RPI-B:
/boot/cmdline.txt already as required
/etc/initab already empty

Then question, any other setup required for WiringPi and for UART, and where to apply?
Last edited by Toulon7559 on Wednesday 18 January 2023 10:23, edited 4 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 848
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: S0PCM & LinkSprite RS485_HAT not operating on RPI_Zero2W&Buster

Post by Toulon7559 »

Checking correspondence related to past experience, found a message from Joost vdLinde hinting that S0PCM best can be connected through a powered_USB-Hub, because often the USB-poort of the interfacing computer has insufficient power available for the upkeep for S0PCM.
The replacement RPI_Zero has an adjoint ETH_USB-HAT, but the aspect 'interface-power-weakness' might be applicable,
because of the RPI's Power Supply usually having no surplus beyond the needs of the RPI's kernel:
worth a try to (re)fit a powered hub as buffer for the S0PCM.

Addition Jan18,2023:
Lesson (re)learned & S0PCM-problem solved .....
Last edited by Toulon7559 on Tuesday 14 November 2023 10:05, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 848
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: S0PCM & LinkSprite RS485_HAT not operating on RPI_Zero2W&Buster

Post by Toulon7559 »

Off-topic observation.
Looking for alternative replacements for my deceased RPI-B, found this gadget from Waveshare mimicking an RPI-3B/B+ with RPI-Zero as kernel.
Question: Why making a semi-RPI-3B with RPI-Zero-performance?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests