How to add xS40 to Neuron L203 using custom software
-
still the Rx on the Extension light is on and I get the same error as I posted before when running
sudo python /opt/evok/evok.py
@martin-kudláček said in How to add xS40 to Neuron L203 using custom software:
The unit is also set as a last one on the RS485 bus
do I need to do something for this? I'm sorry, I'm quite a noob on this.
-
@boy-lenssen Just to be absolutely sure - did you:
- set the DIP switches exactly the same as on the photo
- replaced the /etc/evok.conf with the one I sent you
- restarted evok with sudo systemctl restart evok
The DIP switches need to be set while the extension is OFF and then turned ON.
Thanks,
Martin -
@Martin-Kudláček I created a video of when I turn on the power.
I replaced the evok.conf exactly with what you posted.
I use the SD card I always use and updated it last week to 2.0.7.Here is the video: https://youtu.be/4_BAgph3VSA
and this is the error I see in /var/log/evok.log:
Traceback (most recent call last): File "/opt/evok/neuron.py", line 289, in readboards yield board.parse_definition(self.hw_dict, 1) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run value = future.result() File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run yielded = self.gen.send(value) File "/opt/evok/neuron.py", line 571, in parse_definition self.parse_feature(m_feature, board_id) File "/opt/evok/neuron.py", line 547, in parse_feature self.parse_feature_di(max_count, m_feature, board_id) File "/opt/evok/neuron.py", line 413, in parse_feature_di regpolarity=m_feature['polar_reg'], legacy_mode=self.legacy_mode) File "/opt/evok/neuron.py", line 1394, in __init__ curr_ds = self.arm.neuron.modbus_cache_map.get_register(1, self.regmode, unit=self.arm.modbus_address)[0] File "/opt/evok/neuron.py", line 50, in get_register raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit)) Exception: No cached value of register 1018 on unit 5 - read error 2018-06-21 13:01:08,947 - evok - ERROR - No cached value of register 1018 on unit 5 - read error Traceback (most recent call last): File "/opt/evok/neuron.py", line 289, in readboards yield board.parse_definition(self.hw_dict, 1) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run value = future.result() File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run yielded = self.gen.send(value) File "/opt/evok/neuron.py", line 571, in parse_definition self.parse_feature(m_feature, board_id) File "/opt/evok/neuron.py", line 547, in parse_feature self.parse_feature_di(max_count, m_feature, board_id) File "/opt/evok/neuron.py", line 413, in parse_feature_di regpolarity=m_feature['polar_reg'], legacy_mode=self.legacy_mode) File "/opt/evok/neuron.py", line 1394, in __init__ curr_ds = self.arm.neuron.modbus_cache_map.get_register(1, self.regmode, unit=self.arm.modbus_address)[0] File "/opt/evok/neuron.py", line 50, in get_register raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit)) Exception: No cached value of register 1018 on unit 5 - read error 2018-06-21 12:59:25,738 - evok - ERROR - No cached value of register 1018 on unit 5 - read error Traceback (most recent call last): File "/opt/evok/neuron.py", line 289, in readboards yield board.parse_definition(self.hw_dict, 1) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run value = future.result() File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run yielded = self.gen.send(value) File "/opt/evok/neuron.py", line 571, in parse_definition self.parse_feature(m_feature, board_id) File "/opt/evok/neuron.py", line 547, in parse_feature self.parse_feature_di(max_count, m_feature, board_id) File "/opt/evok/neuron.py", line 413, in parse_feature_di regpolarity=m_feature['polar_reg'], legacy_mode=self.legacy_mode) File "/opt/evok/neuron.py", line 1394, in __init__ curr_ds = self.arm.neuron.modbus_cache_map.get_register(1, self.regmode, unit=self.arm.modbus_address)[0] File "/opt/evok/neuron.py", line 50, in get_register raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit)) Exception: No cached value of register 1018 on unit 5 - read error 2018-06-21 12:59:25,631 - evok - ERROR - No cached value of register 1018 on unit 5 - read error Traceback (most recent call last): File "/opt/evok/neuron.py", line 289, in readboards yield board.parse_definition(self.hw_dict, 1) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run value = future.result() File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run yielded = self.gen.send(value) File "/opt/evok/neuron.py", line 571, in parse_definition self.parse_feature(m_feature, board_id) File "/opt/evok/neuron.py", line 547, in parse_feature self.parse_feature_di(max_count, m_feature, board_id) File "/opt/evok/neuron.py", line 413, in parse_feature_di regpolarity=m_feature['polar_reg'], legacy_mode=self.legacy_mode) File "/opt/evok/neuron.py", line 1394, in __init__ curr_ds = self.arm.neuron.modbus_cache_map.get_register(1, self.regmode, unit=self.arm.modbus_address)[0] File "/opt/evok/neuron.py", line 50, in get_register raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit)) Exception: No cached value of register 1018 on unit 5 - read error
-
Hello @Boy-Lenssen,
here is the image: www.uschovna.cz/zasilka/ALFLHCVAFG743SWB-4SRJust save it on at least 8GB SD card with Win32DiskImager. The IP will be acquired via DHCP.
Martin
-
@martin-kudláček will do, it is downloading, but takes a couple of hours, it says...
btw;
I tried with a new image, Raspbian stretch lite, installed evok and set up the evok.conf for the extension. Same issue...No cached value of register 1018 on unit 5 - read error
-
@Martin-Kudláček I tried your image and gives exactly the same issue.
What now? Am I missing some hardware configuration?
-
Maybe it has something to do with the xS40 or my Neuron? Maybe I could try a different Neuron. Unable to swap the extension unit, as I have only one.
-
@martin-kudláček said in How to add xS40 to Neuron L203 using custom software:
Hello @Boy-Lenssen,
here is the image: www.uschovna.cz/zasilka/ALFLHCVAFG743SWB-4SRJust save it on at least 8GB SD card with Win32DiskImager. The IP will be acquired via DHCP.
Martin
btw, the IP doesn't matter, right? I didn't configure an ethernet connection for your image as it is all local. Just needed to check if the light go on.
I also just use WiFi instead of cabled connection on this device.
-
Hello @Boy-Lenssen,
that's rather odd, if it still doesn't work. You can of course send the extension to us for a warranty claim. But if you have an USB-RS485 converter, you can try talking to the extension directly with this app: https://sourceforge.net/projects/qmodmaster/. Let me know if you will need more help with this.Martin
-
@martin-kudláček I swapped the Neuron, the cables, I used your SD card, I've set the dip switches like you said, nothing works. So I'm starting to expect the extension is defective.
Would the stacktrace I mentioned a couple of times be thrown in case I have the switch incorrect?
I don't have a converter at hand...
I'm thinking of ordering a new xS40 and try it out. If it works, I send the previous one back, if it does work, I keep them both.
Am I missing some hardware specific thing? Are the wires of a different kind than for the other connectors?
Is there anything trivial I'm missing? -
Sorry @Boy-Lenssen,
I think we ran out of ideas what can be wrong. The last thing would be to check whether the extension communicates at all. You could ssh into the Neuron, stop the Evok, run the minicom utility, send some Modbus packet (e.g read register 1000 - the firmware version) and see, if the extension responds to you. But the process is far from being simple and there are caveats along the way which are easy to overlook. -
@boy-lenssen And I really recommend you to purchase the USB-RS485 converter. It is extremely handy for such debugging and it costs around $1 on eBay.
-
@martin-kudláček Hey Martin, I got me one of those things :)
I connected it to the Extension, set the device id to 5, connected and then pressed the 'scan' button.
It shows this error right away: https://imgur.com/a/mVWeGa7
In the mean time, the Rx light flashes a few times and then it stays on.
Edit: hmm, I've set the pins to be port 15 and now both lights are flashing intermediately. That seems to be right...
weird that it doesn't work on 5...
edit 2: I've toggle the dipswitches again to be set to 5, but still doesn't work. I've set the slave address in the qModMaster to 15 and then it works. It looks like it ignores the dipswitches. I've powercycled the device, so it should take the dip switches in consideration...
edit 3: I'm able to toggle the relays be sending value between 0 and 127 on 'write single register'. Device seems to work fine, but only on slave address 15 then
-
Hello @Boy-Lenssen,
from your description, it looks like the DIP switch address settings are ignored, for some unknown reason. They should be ignored only when all of the address switches (3-6) are in upper position, thus indicating address 0. When this is set, the extension will set its address from the SW configuration, which you can change via Modbus register (see documentation, if you are interested in this).Just to be absolutely sure, can you send me a photo of your "address 5" configuration?
Thanks,
Martin -
Hello @Boy-Lenssen ,
we have experienced the same issue with different Neuron unit and different extensions. It could be problem with extension's firmware. We will investigate it a bit more and let you know as soon as possible.Thank you for your patience,
Martin -
Hi @Boy-Lenssen,
would it be possible to use Teamviewer or direct SSH to your controller so we can check what's happening? We will check the extension's firmware version and do the FW update if neccessary.The best time would be between 12:00 and 20:00 CEST.
Thanks,
Martin -
Hi @Boy-Lenssen,
I have created a tutorial, how to flash the firmware via SSH: https://forum.unipi.technology/topic/693/multiple-xs50-on-a-l513-rs485/20Let me know, if you are OK with this. We certainly can update the firmware for you via Teamviewer as promised above.
Thanks,
Martin -
Hi @martin-kudláček ,
sorry for the superlate response! I went on holiday the day after my last post.
I will try to do the upgrade myself and otherwise we can still do a Teamviewer session. will let you know!