Pymodbus

Hi All,

I am trying to install pymodbus on my emonpi. I have attached the logfile I pasted bellow were I think the error is but I am unsure how to fix it.

copying src/twisted/conch/ui/ansi.py → build/lib.linux-armv7l-2.7/twisted/conch/ui
copying src/twisted/conch/ui/init.py → build/lib.linux-armv7l-2.7/twisted/conch/ui
creating build/lib.linux-armv7l-2.7/twisted/conch/test
copying src/twisted/conch/test/test_window.py → build/lib.linux-armv7l-2.7/twisted/conch/test
copying src/twisted/conch/test/test_userauth.py → build/lib.linux-armv7l-2.7/twisted/conch/test
error: [Errno 28] No space left on deviceputty.txt (177.7 KB)

I am trying to use this interface

Can you post the result of this command

df -h

the last line says no space left so the above command should reveal something, what size micro SD card are you using? Did you write the emonSD image to the card yourself or buy it from the shop? If the former, did you use emonExpand to expand the filesystem and partitions to fill the card?

Hi Paul

it was a prebuilt SD card supplied at the same time as my emonpi

I have managed to install it with sudo apt-get install python-pymodbus

output for reference.

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.4G  2.0G  1.3G  62% /
devtmpfs        483M     0  483M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  6.6M  480M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           487M     0  487M   0% /sys/fs/cgroup
tmpfs            40M  6.1M   34M  16% /var/lib/openhab
tmpfs           1.0M  4.0K 1020K   1% /var/lib/dhcpcd5
tmpfs           1.0M  4.0K 1020K   1% /var/lib/dhcp
tmpfs            50M  868K   50M   2% /var/log
tmpfs            30M   44K   30M   1% /tmp
/dev/mmcblk0p1   60M   21M   40M  35% /boot
/dev/mmcblk0p3  3.5G   52M  3.3G   2% /home/pi/data

Hi Paul,

Thanks for the edit.

I now have the interface installed and sort of working.

If I set the register to 40001 I get “Connection failed on read of register: 40001” the same for 30001. but if I change it to 1 I get the correct data back for register 30001

From the manual I have
function code 0X04
Register 0x0001
Data Format Int16
length 1

If I use Modbus master I am able to see the correct values for 0x04 and 0x03 with registers 0-125

I have been having another look today,

if I set the register number to 327 I get a static number for register 40070.

are they any other syntax’s for the register?

Sorry I can’t help with PyModbus itself, I’ve no experience.