Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device not showing up #4

Open
chengler opened this issue Jan 1, 2025 · 14 comments
Open

device not showing up #4

chengler opened this issue Jan 1, 2025 · 14 comments

Comments

@chengler
Copy link

chengler commented Jan 1, 2025

Hello,

Connecting a EM530 over the RS485 to usb cable works.
The SDM 120-M is connectedwith the same cable fails. Connected like this:

8 black
9 yellow
10 orange

restoreGUI.sh forces a GUI restart, so I guess the installation of the software is on the proper place and works.

But I do not find settings like refresh rate.
Energy-meter setup is following:

role: AC-Meter
phase: single Phase
pv inverter on phase 2 position: AC Input 1

How come it knows phase2?

Any hints?

@Telekatz
Copy link
Owner

Telekatz commented Jan 1, 2025

restoreGUI.sh removes the changes made when the script was installed. You must run install.sh again to change the GUI (only V1 GUI) for the script.

@chengler
Copy link
Author

chengler commented Jan 2, 2025

ok, I did a:

./uninstall
./install

patching file /opt/victronenergy/gui/qml/PageAcInSetup.qml
patching file /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py

nothing changes
reboot

USB cable is flickering green and a Energy meter is shows up at setup.

PV Inverter
AC Input1
single Phase

but no Device at devices list, no value

8 GND black
9 B- yellow
10 A+ orange

SDM120-M
se

@Telekatz
Copy link
Owner

Telekatz commented Jan 2, 2025

USB cable is flickering green and a Energy meter is shows up at setup.

PV Inverter
AC Input1
single Phase

but no Device at devices list, no value

How did you see the energy meter at setup if it is not in the device list?

@chengler
Copy link
Author

chengler commented Jan 2, 2025

I guess it is the USB device . In the menu

Energy meter -> K .... ->

@Telekatz
Copy link
Owner

Telekatz commented Jan 2, 2025

No, this menu is only for Carlo Gavazzi meters, not for the Eastron meters with this script.

grafik

@chengler
Copy link
Author

chengler commented Jan 2, 2025

An EM540 was previously connected to the RS4852USB cable. This is probably the reason. Next I will try the following:
nano /data/conf/settings.xml
delete the KX.. in

<DeviceIds ... KX>

delete the

<cwags_KX..>
...
</cwags_KX..>

block

I hope that does the job

@chengler
Copy link
Author

chengler commented Jan 3, 2025

so far, no Energy meters are found. But no other device shows up.
/var/log/message tells

FTDI USB Serial Device converter now attached to ttyUSB0
the adapter shows green flickering

any ideas?

@Telekatz
Copy link
Owner

Telekatz commented Jan 3, 2025

Stop the serial starter:
/opt/victronenergy/serial-starter/stop-tty.sh ttyUSB0

Scan manually with debug information enabled:
/opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py -d -x -s ttyUSB0

Restart the serial starter:
/opt/victronenergy/serial-starter/start-tty.sh ttyUSB0

Send the output of the scan.

@chengler
Copy link
Author

chengler commented Jan 4, 2025

root@raspberrypi2:~# /opt/victronenergy/dbus-modbus-client/dbus-modbus-client.py -d -x -s ttyUSB0

INFO dbus-modbus-client.py v1.61
INFO Waiting for localsettings
DEBUG ===== Settings device init starting... =====
DEBUG Setting /Settings/ModbusClient/ttyUSB0/Devices found
DEBUG Setting /Settings/ModbusClient/ttyUSB0/AutoScan found
DEBUG ===== Settings device init finished =====
INFO Starting background scan
INFO Scanning ttyUSB0 @ 9600 bps (quick)
DEBUG Current transaction state - IDLE
DEBUG Running transaction 1
DEBUG SEND: 0x1 0x3 0x89 0x60 0x0 0x2 0xee 0x49
DEBUG Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG RECV: 0x1 0x3 0x4 0x0 0x0 0x0 0x0 0xfa 0x33
DEBUG Getting Frame - 0x3 0x4 0x0 0x0 0x0 0x0
DEBUG Factory Response[ReadHoldingRegistersResponse: 3]
DEBUG Frame advanced, resetting header!!
DEBUG Adding transaction 1
DEBUG Getting transaction 1
DEBUG Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
DEBUG Current transaction state - TRANSACTION_COMPLETE
DEBUG Running transaction 2
DEBUG SEND: 0x1 0x3 0xfc 0x2 0x0 0x1 0x15 0x9a
DEBUG Changing state to IDLE - Last Frame End - 1735985834.344085, Current Time stamp - 1735985834.352317
DEBUG Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG Incomplete message received, Expected 7 bytes Recieved 2 bytes !!!!
DEBUG Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG RECV: 0x1 0x3
DEBUG Frame check failed, ignoring!!
DEBUG Resetting frame - Current Frame in buffer - 0x1 0x3
DEBUG Getting transaction 1
DEBUG Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
DEBUG ModbusSerialClient(rtu baud[9600]): Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
DEBUG Current transaction state - TRANSACTION_COMPLETE
DEBUG Running transaction 3
DEBUG SEND: 0x1 0x4 0x3 0x2 0x0 0x6 0xd1 0x8c
DEBUG Changing state to IDLE - Last Frame End - 1735985834.476951, Current Time stamp - 1735985834.48434
DEBUG Waiting for 3.5 char before next send - 4.01 ms
DEBUG Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
DEBUG Frame - [b''] not ready
DEBUG Getting transaction 1
DEBUG Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
DEBUG ModbusSerialClient(rtu baud[9600]): Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)
DEBUG Current transaction state - TRANSACTION_COMPLETE

@Telekatz
Copy link
Owner

Telekatz commented Jan 4, 2025

The connection seems to be OK. The response to transaction 1 is the same as on my SDM230. However, the query for the Easton devices is transaction 2. Here only the first two bytes are received.

Have you tried a different baud rate?

@chengler
Copy link
Author

chengler commented Jan 4, 2025

I did. But maybe after restoreGui.sh O_O

Eastron.py offers only faster:

probe.add_handler(probe.ModelRegister(Reg_u16(0xfc02), models,
methods=['rtu','tcp'],
rates=[9600, 19200, 38400],
units=[1,2]))

I could add

rates=[2400, 4800, ... ] ,

and try slower?

@Telekatz
Copy link
Owner

Telekatz commented Jan 4, 2025

Try both. Slower and faster.

@chengler
Copy link
Author

I found an other solution for me in [https://github.com/OpenInverterGateway/OpenInverterGateway], but I am still interested in solving the problem in general. So if you feel like searching, I am happy to learn...

Is there a recommendation to set the Stop bit (it's 1) or the other parameters?

this is the output.
38_4.log
10_2.log
9_6.log
2_4.log

@Telekatz
Copy link
Owner

In the new logs there are now responses with the right lenght but still not the expected data:

DEBUG    SEND: 0x1 0x3 0xfc 0x2 0x0 0x1 0x15 0x9a
DEBUG    Changing state to IDLE - Last Frame End - 1736690795.13879, Current Time stamp - 1736690795.14643
DEBUG    Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG    Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG    RECV: 0x1 0x3 0x2 0x0 0x4 0xb9 0x87
DEBUG    Getting Frame - 0x3 0x2 0x0 0x4
DEBUG    Factory Response[ReadHoldingRegistersResponse: 3]
DEBUG    Frame advanced, resetting header!!
DEBUG    Adding transaction 1
DEBUG    Getting transaction 1
DEBUG    Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
DEBUG    Current transaction state - TRANSACTION_COMPLETE

Have you terminated the RS485 bus correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants