emonHub + emonBase on Ubuntu Snappy

Hi all,

I've been working on packaging emonHub for Ubuntu Snappy, which I think would be a great base for emon on the Pi.

 

The packaging is going well, but I've been unable to boot the Pi with emonBase attached - I get a boot prompt for a split second and then a lot of garbage on screen. It's as if the emonBase triggered something in the bootloader. Having removed emonBase it boots fine.

 

Has anyone seen such behaviour? Any ideas how to proceed?

 

Thanks,

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Just a follow-up, I learned that this is likely due to wrong dtb/kernel setup in the default Snappy for Pi image. We're working on enabling overlay dtbs and other bits so this could get hopefully resolved soon.

pb66's picture

Re: emonHub + emonBase on Ubuntu Snappy

is the serial port free for the rfm2pi or is it being used for serial console?

I can see ubuntu for arm7 was changed in feb to not enable the serial console at boot, 

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Found this in uEnv.txt:

mmcargs=setenv bootargs "console=tty0 console=ttyAMA0 root=${mmcroot}"

This looks like the culprit, I'll try it out without the console= entries.

 

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Changing that didn't help. It seems it never gets past u-boot. It seems u-boot itself is accepting input on ttyAMA0.

Is it written anywhere what kind of setup does the Pi require to work with the RFM96Pi?

pb66's picture

Re: emonHub + emonBase on Ubuntu Snappy

It's very difficult to see any detail on your video, but I'm still inclined to think it is a serial console clash, I don't know anything about "snappy" so I'm far from sure, but the screen just filling up that fast (only when RFM69Pi is connected) with garbage is probably caused by the RFM69Pi not understanding the console output at 115200 baud (or any baud) and responding with help text at 38400 which is garbage to the Pi.

The RFM69Pi doesn't really need anything from the Pi other than power, when powered up the firmware runs and outputs to the serial port @ 38400 baud in ascii. The Pi just has to offer exclusive access to the serial port and read what arrives.

Paul

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Yeah it just says:

Net: Net Initialization Skipped
No Ethernet found.
Hit any key to stop autoboot: 0
U-Boot>...

And then garbage. It must be that u-boot is interfacing with the tty, as you say, at a different baud. I need to find out how to stop it doing that.

Snappy, FWIW, is just a new way of distributing Ubuntu and apps for it. But the base system is built from Ubuntu archives wherever possible.

pb66's picture

Re: emonHub + emonBase on Ubuntu Snappy

The changelog on the "Ubuntu for ARM7" page I linked to previously says

Removed console=ttyAMA0,115200 from default cmdline.txt (interferes with non-console use of the serial port)

Have you tried removing "console=ttyAMA0,115200" from cmdline.txt? this is a standard procedure to free up the serial port on Raspbian too.

Paul

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Removing the console=ttyAMA0 bit from uEnv.txt made it possible for me to connect the RFM96Pi after the OS booted and stuff's working, emonhub's getting messages and all.

I will try and find where to disable ttyAMA0 in u-boot tomorrow. But there's progress, thanks!

Saviq's picture

Re: emonHub + emonBase on Ubuntu Snappy

Success!

Not a long-term solution, but I managed to get things working. One big difference between the snappy setup is that it uses U-Boot to be able to toggle between two rootfs installs for update and rollback support.

U-Boot has serial support enabled by default, because it is, after all, quite a common way to interface with an embedded board like the Pi. The only way I found to disable it was to set bootdelay to 0, meaning u-boot does not wait for any input but just boots straight away. It's not great, because that means you can't interrupt the boot process using a keyboard (or serial, when you connect it instead of the RFM69Pi, but that's expected with that board, isn't it?).

Anyway, for anyone that wants to try, emonhub is packaged1 for Ubuntu Snappy, and I've built an image2 that you can put in your Pi. I also packaged minicom3 for debugging. User/password is ubuntu/ubuntu, you can go to http://emonpi:4200 to see a minimal web management system. In theory http://webdm.local:4200 should work, too, if avahi does all it's supposed to. You can manage software on the device through it. http://webdm.local:8080 is mosquitto's website that can show you your MQTT traffic.

You can find out more about snappy on the Ubuntu website4, I will try to answer any questions if you have them, too.

Unfortunately the base system itself can't be updated right now because of the proprietary bits on the Pi - so we can't host it on Ubuntu servers. We're working to resolve that.

I'm off to package the bigger bits - emoncms here I come ;)

1 https://uappexplorer.com/app/emonhub.saviq

2 https://owncloud.sawicz.net/index.php/s/ZBjrRlngP0kzQ8a?path=%2FemonPi

3 https://uappexplorer.com/app/minicom.saviq

4 http://www.ubuntu.com/cloud/tools/snappy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.