Upgrade from 1.0 to 2.0

Old openzmeter models based on Debian OS (Armbian) can upgrade to latest firmware based on OpenWRT.

Follow the steps provided in https://openzmeter.com/2020/07/20/upgrade-firmware-for-old-ozm-versions/

I decided to build a working openZmeter with nanoPi before I try to play with the RaspberryPi.

Therefore I flashed a vanilla nanoPi with this image (openZmeterUpdateEMMC.img) and the nanoPi boots. It also shows up as a Bluetooth device, but unfortunately the tethering does not seem to work.

I manually assigned an WLAN in “/etc/config/wireless” and I can ssh to the unit. Also the openZmeter is running, however I cannot log in with the default credential as mentioned in the git wiki.
Looking in the log files I get the following error:

Error in SQL query (ERROR: relation “users” does not exist)

Do I have to create the database by hand when using this image?

The STM32 board makes one long beep and two short beeps every once in a while.

No, you dont need to manually create database, maybe update image is wrong. As you can connect to the board, please do the following:

  • run ‘/etc/init.d/openZmeter stop’
  • download http://openzmeter.com/downloads/openZmeter and move to /usr/sbin
  • run ‘psql --user postgres’ and then:
    • ‘drop database openzmeter;’
    • ‘create database openzmeter;’
    • ‘alter database openzmeter owner to openzmeter;’
    • ‘\q’
  • ‘opkg update’
  • ‘opkg install libopenssl1.1’
  • run ‘/etc/init.d/openZmeter start’

This is the latest version, please tell us if it works correctly after that.

Thank you very much. This solved the problem with the database and openZmeter is running now. I can use the virtual channel and everything runs smoothly on the nanoPi Air.

Some other commands which might be useful for others:

  • ‘ALTER ROLE openzmeter WITH PASSWORD ‘openzmeter’;’
    to change the password of the user

  • and ‘opkg update && opkg install usbutils’
    for use of lsusb command

However the STM USB device does not show up in the ‘dmesg’ output. Only the two internal USB hubs.:

root@openZmeter:~# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

On my PC it shows up like that:

kernel: [65434.820127] usb 1-2: new full-speed USB device number 13 using xhci_hcd
kernel: [65434.971456] usb 1-2: New USB device found, idVendor=0483, idProduct=7270, bcdDevice= 2.01
kernel: [65434.971463] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [65434.971467] usb 1-2: Product: openZmeter - Capture device
kernel: [65434.971470] usb 1-2: Manufacturer: zRed
kernel: [65434.971473] usb 1-2: SerialNumber: 2100A2008034E47573935302

Do I need a driver or anything to see the device? I am connected to D+ and D- of USB2.

Hi, USB should run without any aditional module/package/driver.

You should see in nanopi the same dmesg log you see in PC. Please, test the follow:

  • Unplug ozm from mains (and keep it disconnected while testing)
  • Boot your nanopi powered with USB cable.
  • Once booted, login and listen to system messages ‘logread -f’
  • Plug nanopi in ozm board
  • In meesage log you should see some “USB discovery” messages.

If you do not see nothing, we have a problem, maybe nanopi usb port is damaged