Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Upgrade Challenges - emonSD-26Oct17 to emonSD-24Jul20

Hi All,

I was wondering if I could ask for some general pointers in upgrading my old emon Pi which is running emonSD-26Oct17.

I can see several support articles which advise that the automatic upgrade will not work due to the old version I am running so I have performed the following to no avail:

  1. Followed this upgrade guide: [Update & Upgrade - Guide | OpenEnergyMonitor]

I am using a new SD card (16GB) and have opted to flash this using Etcher and have installed the latest SD-24Jul20 img which I downloaded recently.

I can see the /boot directory on the SD Card and when I plug this in to my Emon PI I see the following:

[email protected](ro)data$ **dmesg**

[ 1601.306962] usb 1-1.4: New USB device found, idVendor=aaaa, idProduct=8816
[ 1601.306977] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1601.306985] usb 1-1.4: Product: MXT USB Device
[ 1601.306992] usb 1-1.4: Manufacturer: MXTronics
[ 1601.307000] usb 1-1.4: SerialNumber: 150101v01
[ 1601.308169] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[ 1601.308538] scsi host0: usb-storage 1-1.4:1.0
[ 1602.346967] scsi 0:0:0:0: Direct-Access MXT-USB Storage Device 1501 PQ: 0 ANSI: 0 CCS
[ 1602.348273] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1602.348962] sd 0:0:0:0: [sda] 31719424 512-byte logical blocks: (16.2 GB/15.1 GiB)
[ 1602.349250] sd 0:0:0:0: [sda] Write Protect is off
[ 1602.349263] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 1602.349544] sd 0:0:0:0: [sda] No Caching mode page found
[ 1602.349554] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 1602.352442] sda: sda1 sda2 sda3
[ 1602.355974] sd 0:0:0:0: [sda] Attached SCSI removable disk

Running sudo fdisk -l seems to show the SD disk is present.

**[email protected](ro)**:**data**$ sudo fdisk -l
...

**Device Boot Start End Sectors Size Id Type**
/dev/mmcblk0p1 * 8192 131071 122880 60M 6 FAT16
/dev/mmcblk0p2 131072 7288831 7157760 3.4G 83 Linux
/dev/mmcblk0p3 7288832 14786559 7497728 3.6G 83 Linux

Disk /dev/sda: 15.1 GiB, 16240345088 bytes, 31719424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x43ed7bb4

**Device Boot Start End Sectors Size Id Type**
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/sda2 532480 9256959 8724480 4.2G 83 Linux
/dev/sda3 9256960 30228479 20971520 10G 83 Linux

**[email protected](ro)**:**data**$

running cat /proc/mounts shows the following:

**[email protected](ro)**:**data**$ cat /proc/mounts

/dev/root / ext4 ro,noatime,nodiratime,errors=remount-ro,data=ordered 0 0
devtmpfs /dev devtmpfs rw,relatime,size=492508k,nr_inodes=123127,mode=755 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
tmpfs /var/lib/openhab tmpfs rw,nosuid,nodev,relatime,size=40960k 0 0
tmpfs /var/lib/dhcpcd5 tmpfs rw,nosuid,nodev,relatime,size=1024k 0 0
tmpfs /var/lib/dhcp tmpfs rw,nosuid,nodev,relatime,size=1024k 0 0
tmps /var/log tmpfs rw,nosuid,nodev,relatime,size=51200k 0 0
tmpfs /var/tmp tmpfs rw,nosuid,nodev,relatime,size=1024k 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime,size=30720k 0 0
/dev/mmcblk0p1 /boot vfat rw,noatime,nodiratime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0
/dev/mmcblk0p3 /home/pi/data ext2 rw,noatime,nodiratime,block_validity,barrier,user_xattr,acl,errors=remount-ro 0 0

**[email protected](ro)**:**data**$

mount -l shows the following…

**[email protected](ro)**:**data**$ mount -l

/dev/mmcblk0p2 on / type ext4 (ro,noatime,nodiratime,errors=remount-ro,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=492508k,nr_inodes=123127,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /var/lib/openhab type tmpfs (rw,nosuid,nodev,relatime,size=40960k)
tmpfs on /var/lib/dhcpcd5 type tmpfs (rw,nosuid,nodev,relatime,size=1024k)
tmpfs on /var/lib/dhcp type tmpfs (rw,nosuid,nodev,relatime,size=1024k)
tmfs on /var/log type tmpfs (rw,nosuid,nodev,relatime,size=51200k)
tmpfs o /var/tmp type tmpfs (rw,nosuid,nodev,relatime,size=1024k)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=30720k)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,nodiratime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) [boot]
/dev/mmcblk0p3 on /home/pi/data type ext2(rw,noatime,nodiratime,block_validity,barrier,user_xattr,acl,errors=remount-ro)

**[email protected](ro)**:**data**$

Issue:

  • When I restart my Emon Pi it does not seem to boot using the new SD-Card image. It defaults back to the same image installed on the EMon Pi.
  • I am not able to create a config backup via the admin interface as I wait for ages for a URL link to appear however this doesn’t materialize.

It is not clear from the upgrade guide if I need to modify / set specific boot parameters or something as I cannot seem to get the Emon Pi to mount the SD-Card that has been installed ?

I have attached a picture showing my emon pi server information for reference too.

Any pointers appreciated as it would be great if I can back up my config and upgrade followed by a restore.

Thanks in advance

Matt

Formatted text - Moderator, BT

Hello @ipbloke If Im following correctly you a plugging the new SD card and reader into the USB socket of your Pi running the older image? You want to be doing it the other way around. So plug the new SD card into the Pi’s SD card slot and then the old SD card into the reader, it should then work ok.

Hi TrystanLea

Thanks for getting back to me. I must be missing a trick here as my Emon Pi doesn’t have an SD card slot (unless you mean for me to unscrew the metal casing to get access to Pi itself ?

Here is a couple of photo’s showing what I have.

I have inserted the (flashed) SD card which contains the image I used (emonSD-24Jul20.img) into the card reader and then inserted this into one of the 4 x USB ports.

Apologies if I am missing something here ?

Thanks

Matt

Hello Matt, yes sorry, you do need to unscrew the fascia to get to the SD card slot and insert the SD card in the slot on the PI itself.

1 Like

Then plug the old card into the reader to import the data.

2 Likes

Thanks @TrystanLea & @borpin - After unscrewing the facia then yes I can now see the 'Micro SD ’ card. This step isn’t listed in the upgrade guide however is this because newer models of the EmonPi expose the SD card without needing to unscrew the faceplate ?

Unfortunately I don’t have a micro SD card lying around at the moment in which to deploy the new image however it doesn’t look like the default 8GB supplied with my original Pi is big enough for the latest image. Is it worth buying something bigger than 16GB today (to cope with future upgrades) or if i were to order one from you directly (as I can see the upgrade guide offers this) then will this suffice (again for future upgrades) ?

Thanks again

Matt

It is possible to get it onto an 8 GB card, but ‘downsizing’ the downloaded image is convoluted and tiresome, and of course there will be less space available for data.

Thanks Robert thats a good option to have. Given my limited knowledge here TBH i would probably hedge my bets and pay for a new Micro SD card otherwise i’ll end up spending more time and energy trying to do your suggestion :slight_smile:

I would advise that. It involved quite a few steps and wasn’t at all straightforward. I followed this but with some small changes:

from the heading:
Shrinking images on Linux
to the bottom.

Where it states:

Now notice a few things:

  • There is one partition.
  • The partition allocates the entire disk/device/image.

that’s not correct, it showed all the usual partitions. At that stage, I used GParted to resize the 10 GB partition only down to not very much (i.e. so that the total was well below 8 GB, then finally, when it was on the 8 GB SD card, expanded it again with GParted to fill the card).

I can understand why the image was made as 16 GB (except I could only get a 32 GB locally - from Argos), but it’s an awful lot easier to expand the partition than shrink the image.

1 Like