I've uploaded a new updated emoncms raspberrypi harddrive setup image which fixes a few bugs that where in the last one, there where a few problems with packetgen conflicting with emonglcd time sending and also having the possibility to get stuck just continuously sending rf packets both of which have now been fixed.
The latest image can be downloaded here
http://217.9.195.228/2014-01-20-emoncms_raspberrypi_hdd_stack.zip
which is also linked from the main emoncms.org documentation here http://emoncms.org/site/docs/raspberrypihdd
The upgrade steps for those of you who are using the first image and dont want to start from scratch are the following fairly extensive list of terminal commands (sorry). These will download the latest updates to emoncms core and the add-on modules.
System update steps sudo apt-get update sudo apt-get upgrade Downloads 153MB takes a bit of time. Emoncms and modules update steps cd /var/www/emoncms git pull git checkout master cd /var/www/emoncms/Modules/packetgen git pull cd /var/www/emoncms/Modules/raspberrypi git pull git checkout raspberrypi_run.php git checkout master git pull cd /var/www/emoncms/Modules/event git pull git checkout master git pull cd /var/www/emoncms/Modules/mqtt git pull cp /var/www/emoncms/Modules/packetgen/copyto_raspberrpi_module/raspberrypi_run.php /var/www/emoncms/Modules/raspberrypi redis-cli >flushall sudo /etc/init.d/rfm12piphp restart Setup RFM12Pi firmware update system sudo apt-get install arduino sudo apt-get install python-dev&&python-rpi.gpio git clone https://github.com/mharizanov/avrdude-rpi.git cd avrdude-rpi sudo cp autoreset /usr/bin sudo cp avrdude-autoreset /usr/bin sudo mv /usr/bin/avrdude /usr/bin/avrdude-original sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude cd /home/pi git clone https://github.com/mharizanov/RFM2Pi.git
Re: New emoncms raspberrypi harddrive image
Hi Trystan,
i updated my system using the info supplied and all seemed to go well apart from the fact that the time on my emonGLCD is no longer updating from my raspberry Pi base.
anything obvious I should check? Last time this happened it was down to an issue with packetgen code I think.
Regards, Keith
Re: New emoncms raspberrypi harddrive image
Bit more information, running the serial monitor on the emonGLCD I am getting the following info:-
Mymon2 GLCD example
Node: 20 Freq: 433Mhz Network: 210
RX
NODE 15Received from 15 Pi ; Node 15
; CRC 0 ; HDR 15 ; Data1 0 ; Data2 35 ; Data3 0 ; Data4 35 ; Data5 0 ;
RX
NODE 10Received from 10 emontx ; Node 10
; CRC 0 ; HDR 10 ; Data1 4 ; Data2 108 ; Data3 91 ; Data4 0 ; Data5 0 ; Power1 1071
RX
NODE 15Received from 15 Pi ; Node 15
; CRC 0 ; HDR 15 ; Data1 0 ; Data2 35 ; Data3 0 ; Data4 35 ; Data5 0 ;
RX
NODE 15Received from 15 Pi ; Node 15
; CRC 0 ; HDR 15 ; Data1 0 ; Data2 35 ; Data3 0 ; Data4 35 ; Data5 0 ;
RX
NODE 10Received from 10 emontx ; Node 10
; CRC 0 ; HDR 10 ; Data1 4 ; Data2 77 ; Data3 91 ; Data4 0 ; Data5 0 ; Power1 1070
So it looks like the Pi is not broadcasting the correct time info in its packets since the update, the LCD is showing time of 0:35. Time on the Pi is correct.
Regards, Keith
Re: New emoncms raspberrypi harddrive image
Hello Keith
I think its to do with the old packet being saved in the database without the time fields. I've added a little feature that can be used for reset the packet to the default template packet. If you do another git pull on packet gen you should get it:
cd /var/www/emoncms/Modules/packetgen
git pull
Re: New emoncms raspberrypi harddrive image
That sorted it. When I looked at the Packet Generator page I can see where the 35 is coming from! Default values set up now and suddenly the time is correct on the display. Many thanks for the quick fix.
Keith
Re: New emoncms raspberrypi harddrive image
I uploaded the new image and modules last night (24th Jan) and had the same problem as Keith.
Re-pulled the packetgen module but was told it was already uptodate. Rebooting the Pi and the GLCD now shows the time stuck at 6.28am not the 0.35am prevoiusly.
What is going on or should I say not going on?
Re: New emoncms raspberrypi harddrive image
I just followed this sequence update, and now my Edimax Wifi adapter no longer works. It appears that the driver is no longer loading. It worked prior to this update.... I am working on installing the driver, but most info indicates that it should be included in the kernel already
Re: New emoncms raspberrypi harddrive image
Just to update further -- it appears this update brings you 3.6.11+ for which there don't seem to be any kernel headers. As a result many drivers are not included... looks like the only way to go will be to manually install the driver for my wifi dongle
Re: New emoncms raspberrypi harddrive image
Do you think it would be worth recreating the image without the update? how difficult is it to add the drivers?
Re: New emoncms raspberrypi harddrive image
Hi Trystan
If you do create a new image may I suggest you make it larger. I ran into a problem with update due to lack of space. I had to shut down and resize partition with a PC.
Regards
Ian
Re: New emoncms raspberrypi harddrive image
Ok, I had some more time to work on this. What I found (and I still don't completely understand it) is that even if you start with the latest Raspbian image from here: http://downloads.raspberrypi.org/raspbian_latest, they don't seem to include the drivers that are compiled in the kernel. However, the version of Raspbian that you included in the first version did have those drivers. The part that has confused me more is that even though the previous version worked, it seems to have the same kernel:
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
The problem I find is that when upgrading via
sudo apt-get update
sudo apt-get upgrade
Those modules no longer get loaded for anything. Right now my solution has been to revert back to the version of Raspbian that you imaged originally, and then just updating emoncms. Does make this sense? You can tell that there aren't any drivers loading by typing:
lsmod
This should yield several things printing (they are loaded kernel modules) - my wifi dongle should be one of them.
After updating, lsmod showed nothing....
What I think is happening is that the new raspbian version has upgraded to something like 3.10.x but the system is still running kernel 3.6.11. When it goes to load the kernel modules (ie drivers) it looks in /lib/modules/[Kernel version] and can't find any drivers for 3.6.11, and thus loads nothing...
Any ideas?
Re: New emoncms raspberrypi harddrive image
Hi
I have just set up a new emoncms using the 17 jan image from scratch.
I can now confirm that that image does not install any drivers so my wifi and mouse do not work.
Regards
Ian
Re: New emoncms raspberrypi harddrive image
Hi,
Have been using the SD method successfully for a while but thought I'd give the HDD version a go. The install all appeared to go well until after about 7hrs all my feeds stopped reporting with no light flashing on the RFM12Pi.
I swapped back in my previous SD card and all was back to normal so I think it must be a software issue. Have tried both the new HDD image and the previous one manually upgraded and have the same issue, works for a while then the RFM12 gives up.
My RFM12Pi is v1 rather than the newer v2. Could that be caousing a problem?
Re: New emoncms raspberrypi harddrive image
RFM2Pi v1 can fail if the "broadcast time for emonGLCD" option is turned on. Maybe it is on by default in one version and not in the other ? (Check oemgateway.conf)
Regarding the partition size, I don't know about the ready-to-go SD card, but in Raspian, there is a nice feature allowing you to resize the partition just after the install, to fit the card. I could expand the image to my whole 32 GB card.
Re: New emoncms raspberrypi harddrive image
Hi,
I think I have the same problem. My USB-devices like my mouse don't work. During the booting I got some errors with "/lib/modules/3.6.11+/"... Is there any fix for this or can I download anywhere the older image version?
Re: New emoncms raspberrypi harddrive image
Hi
I don't know of a fix. lsmod will show no modules. The older image (lower down on the same page http://emoncms.org/site/docs/raspberrypihdd) works provided you do not run update and upgrade as ugrading also removes all the drivers. I understand if you use the latest raspbian image from http://www.raspberrypi.org/downloads and install emoncms from scratch it works OK. I have not tried this as I am able to run on a wired connection (As wifi also will not work) until a fix is available.
Regards
Ian
Re: New emoncms raspberrypi harddrive image
Hi,
I experienced some of these issues too and found the problems seem to be caused by the pi not recognising it has the 3.10.25+ kernel not the 3.6.11. This is because of the sdcard boot partition not mounting correctly and not getting updated. this in turn means the files on the boot partition have not been updated. this fix worked for me
I have made a copy of the boot.img with the updated 3.10.25+ files on a partition so that it gets mounted correctly. just replacing the existing boot.img with this new boot.img should sort most of these issues but to be safe the old 3.6.11 files should also be removed to avoid future confusion. (there is also a redundant txt file called "NEW BOOT_IMG" this is just for identification and confirmation use and can be deleted after)
So if you have these symptoms
1 - "lsmod" returns an empty list
2 - "uname - a" returns 3.6.11
try replacing the boot.img if it doesn't work you can always change back
You can download it from my dropbox here https://www.dropbox.com/s/xok2zvs85gwwv35/boot.zip it's only 16MB
After changing the boot.img you should get these results straight after booting up
1 - "lsmod" returns a list of loaded modules (inc wifi if usual dongle connected)
2 - "uname - a" returns 3.10.25+
if successful the step-by-step instructions to "clean-up" are as follows
cd /boot
ls
confirm the "NEW BOOT_IMG" file is there
cd ../
sudo umount /boot
cd /boot
ls
confirm the "NEW BOOT_IMG" file is NOT there
sudo rm *
cd ../
sudo mount /boot
cd /boot
confirm the "NEW BOOT_IMG" file is there again
the boot partition on the hdd is not used but may cause confusion so copy your sd card to that partition just to be tidy
sudo dd if=/dev/mmcblk0p1 of=/dev/sda1 bs=1M count=57
Apt-get update and apt-get upgrade should also work correctly now.
Hope this helps
Paul
PS this works with the stock 20th jan 2014 image so if you have made changes to the partition structure you should factor that in.
Re: New emoncms raspberrypi harddrive image
Hi Paul
Many thanks, that worked like a charm. I now have wifi back.
The only odd thing was that I got the following when I tried to copy to the boot partition on the hdd.
pi@Emoncms1 /boot $ sudo dd if=/dev/mmcblk0p1 of=/dev/sda1 bs=1M count=57
dd: writing `/dev/sda1': No space left on device
57+0 records in
56+0 records out
58720256 bytes (59 MB) copied, 5.5938 s, 10.5 MB/s
I assume it does not matter.
Regards
Ian
I spoke too soon. Wifi seems to be cutting out after a while. Comes back with a reboot. Something else to investigate!
Re: New emoncms raspberrypi harddrive image
Hi Ian,
I'm glad it worked (even if it was only for a while) there are a lot of reports of wifi dropping out on RPi, nothing to do with the OEM or EmonCMS software. I'm currently using an ethenet cable as wifi kept dropping out but have since seen several blogs etc suggesting a cron entry to ping the router every min or so and if no response restart wifi. I haven't tried it yet but it sound like it should work. sorry I didn't keep any links, googling should work.
and no that message doesn't really matter at all.
thanks for the feedback
Regards Paul
Re: New emoncms raspberrypi harddrive image
Hi Paul
The odd thing about the wifi dropping out is that before I upgraded as per Trystan's instructions at the beginning of this thread the system had been up and running for months. It makes me think something has changed in the software as the hardware is unchanged. I had switched to a hard drive installation a long time ago using berryboot as prior to that I had very bad experiences with SD cards failing.
Regards
Ian
Re: New emoncms raspberrypi harddrive image
Hi Ian
I wish I knew the answer, I've always been plagued with wifi issues with RPi, even though the hardware and the software has been changed numerous times, in fact the only thing that has been consistent is poor wifi. I have multiple pi's two different types of wifi adapter, various usb hubs and power supplies but I am yet to find an acceptable level of service. to be fair I haven't tried too hard to fix it as I am currently wired due to using remote desktop & xrdp alot and its a pain even if it drops out once.
My wifi was at its best immediately before I switched to a hdd, After the switch it was so poor I plugged in a lead. I hadn't installed emoncms then so it wasn't that. I have since installed emoncms and when i tried wifi after the fix above it worked but as I couldn't get xrdp to work with the emoncms image (another issue to sort) I went back to my previous image until I have time to address the xrdp issue.
Whilst i'm no expert, I think any wifi issues introduced by this image are more likely to be due to the raspbian update rather than emoncms, in fact now I think about it, coincidentally I upgraded to 3.10.25 from 3.6.11 at the same time as installing the hdd.
I would like to go back to a wifi connection but have had more pressing and interesting issues to deal with 1st. I think some community collaboration on RPi wifi and maybe a new Raspberry Pi WiFi thread as a focus point could be in order as you are definitely not alone.
Regards Paul
Re: New emoncms raspberrypi harddrive image
Guys-
I experienced wifi dropping out also and found that if I added the line:
wireless-power off
to /etc/network/interfaces
it helped. My wifi device has been reported to go to sleep if this line isn't present. Since adding this line, I've had reliable wifi access to my Pi.
In terms of the boot.img, I think that makes sense. I found after upgrading the kernel wasn't right, and such the drivers didn't work. I'll give it a try when I get a chance...
Re: New emoncms raspberrypi harddrive image
Thanks Pauls, seems to work for me. I don't use a wifi device, but know I can use my FTDI-programmer. I got also the message "No space left on device" like Ian but it works anyway.
Re: New emoncms raspberrypi harddrive image
Great, thanks a lot for the fix Paul.
The new boot image has been zipped up into a new image download
http://files.openenergymonitor.org/2014-02-23-emoncms_raspberrypi_hdd_stack.zip
Re: New emoncms raspberrypi harddrive image
Many thanks Sbeausol. Great stuff!
Adding wireless-power off seems to have cured my wifi dropping out.
Regards
Ian
Re: New emoncms raspberrypi harddrive image
Ian - ssssssssshhhhhhhhh! don't speak too soon :-) bloody wifi! I thought I would give Sbeausol's suggestion a try, so as I haven't been using it recently I connected wifi without adding "wireless-power off" first, to compare against and its been perfect all day... typical
Glyn - glad it helped, There is another thread with the same problem, I will link it to here so the new image can be found.
Also I though it was worth mentioning that Glyn has added the new boot image to the existing hdd image so if you already have the hdd image you can still just replace the boot image, downloading the 16MB zipped boot image will be quicker and less strain on oem site than downloading the whole 1GB zipped image.
Paul
Re: New emoncms raspberrypi harddrive image
Marvelous, now I can get the watchdog running to try and improve my uptime :)
Will the kernel headers problem re-occur whenever the Kernel is updated ?
Re: New emoncms raspberrypi harddrive image
Not if the sd card's boot partition is mounted to the /boot folder of the root file system (hdd). if its not mounted then any kernel update process will just put the new boot files in the folder /boot on the hdd which will never get used.
if you run mount at the command line this line
/dev/mmcblk0p1 on /boot type vfat
means its mounted and any updating of the kernel or packages should be successful.
Regards Paul
Re: New emoncms raspberrypi harddrive image
Thanks Paul, I've got :-
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
so I guess I'm ok ?
Re: New emoncms raspberrypi harddrive image
Paul you made my day. !!I
was struggling to get my I2C connection right (to add a LCD) but didn't get the kernel update working with rpi-update. Now it connects perfectly and I gonna try to make an emon GLCD on the RPI :)
Re: New emoncms raspberrypi harddrive image
Thanks for the update. I have gone though with it but have not had the chance to test anything. an important note though. you should be able to copy /paste the whoe line of commands into putty or other ssh program and the pi will execute them one after another. it gets a little confused at the
redis-cli
>flushall
section as you do not have an "exit" command after this to continue the script.(If you could call it that) - You just have to do each update by pasting in that section otherwise.
Re: New emoncms raspberrypi harddrive image
Trying to install the Root files into a 21GB HDD partition - sda2, but although dd appears to copy the files OK with no errors reported, when I check the integrity of the partition I get the error 'The file system is not clean'.
I've reformatted sda2 and gone through the process again, but still get the same result.
Any ideas?
My intention was to edit the cmdline.txt file (boot) to point to the new root partition.
Re: New emoncms raspberrypi harddrive image
Hello Paul, which guide, system setup are you following? If your settings up a new system it might be worth skiping to the new emonhub + emoncms (low write version). There's documentation on how to use it with a harddrive and update to the full version of emoncms if you wish too. https://github.com/emoncms/emoncms/tree/bufferedwrite
I've just been updating the links on the site: guide, modules, emoncms.org etc to point to it and have archived the old harddrive build. Maybe we should start a new thread as this one references the older harddrive build?
Re: New emoncms raspberrypi harddrive image
No, I wasn't using that version, I followed the link from emoncms.org to the old version.
I'll try the new version tonight when I get home.
Thanks
Paul
PS, I've locked this thread now