IoT, updating kernels with a Ultibo webserver

The place to share and discuss your Ultibo projects.
Gavinmc42
Posts: 1656
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

IoT, updating kernels with a Ultibo webserver

Postby Gavinmc42 » Thu Jun 09, 2016 4:39 am

I make Pi based IoT gadgets that go on a University Network.
Fridge temperature alarms, power monitors etc.

Application Lifetime Management. nasty words to IT support staff ;)
How to support a bunch of gadgets over the life of the applications.
My coding gets better over time so I can add fancier webpages, more features etc.
Backups of code etc, logging, plotting, webserving.
Can be a real mess, different versions, copying, modifying code etc

I just tested a Pi3 running the webserver example code, with a www/update folder that contained the new kernel.img for a Pi B.
Needed to include ShellUpdate in uses for the B and add the updating server computer ip address and path in the cmdline.txt
Telnet in and do update get, then restart, bingo new version.

It worked, I can update a Pi from another Pi running the Ultibo webserver example.
Gavinmc42
Posts: 1656
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: IoT, updating kernels with a Ultibo webserver

Postby Gavinmc42 » Thu Jun 09, 2016 7:06 am

Cut and pasted my html code from ones of my piCore IoT boxes into Ultibo's webserver example /www folder.
Pointed browser at it and here is a screen dump of it working.

This is HTML5 code copied from a Pi running piCore OS serving via busybox-httpd, no changes except the log file folder.
It also includes the dygraphs javascript plotting file.

Still need i2c working so I can read the sensor data.
Not sure how long before i2c is working but tests on compiled GPIO bit toggling around 4MHz means it could even be bit banged?
Also need to test logging to the sdcard.

This is day 4 playing with Ultibo.
Attachments
plot.jpg
plot.jpg (121.69 KiB) Viewed 1763 times
User avatar
Ultibo
Site Admin
Posts: 2280
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: IoT, updating kernels with a Ultibo webserver

Postby Ultibo » Thu Jun 09, 2016 10:45 am

Nice work Gav, even though I know this should work it's always cool to see it actually working. I think you've got the beginnings of a really neat remote monitoring and sensing solution here, it will be nice to see where you go with it.

Gavinmc42 wrote:Still need i2c working so I can read the sensor data.
Not sure how long before i2c is working but tests on compiled GPIO bit toggling around 4MHz means it could even be bit banged?

I2C is not far away, no kidding, I've just been spending a couple of days getting this TCP timing thing sorted out and then we'll get to work on finishing the I2C and SPI drivers. You probably could bit bang it but since the Pi has 2 I2C controllers on board it hardly seems worthwhile.

Gavinmc42 wrote:Also need to test logging to the sdcard.

This post viewtopic.php?f=10&t=46#p104 has some info about how to log to a file, if it doesn't cover enough let me know and I'll fill in any missing details. All the necessary bits are there to do this, maybe the only limit is the data rate for an SD.

Gavinmc42 wrote:This is day 4 playing with Ultibo.

Kicking goals big time, you should have the world sorted by day 7 :D
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1656
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: IoT, updating kernels with a Ultibo webserver

Postby Gavinmc42 » Thu Jun 09, 2016 12:51 pm

Not 7 days :lol:
But you have accelerated my roll out plans at least 6 months.

I was just as surprised when it just worked, tomorrow I will try the HTML code from my 9 sensor box.

Was not going to mention the TCP issue because I know you are working on it.
It does come first, fixing that ;)
I have the logging stuff to look at in the mean time, did a quick glance and it looks even more than I need.
I'm sure I will find a use for syslogging:)

Bit banging the i2c might come in handy one day, have run into some i2c problems with the Pi, re auto address incrementing etc.
Once the i2c works I can probably whip out a bunch of examples real quick.

Need to wait until someone smarter figures out framebuffer plotting, tried a few years ago.
Not so easy, think I tested every plotting method there is, massive libraries/dependences for one graph?
SVG is the simplest, in-line HTML, ugly code.

Ron's code for the SPI TFT LCD and CP/M is real impressive, brought back memories of Microbee's and Minix1616.
Got me thinking, a 2 x16 LCD character GPIO driver should be easy just to display the IoT gadget's ip address.
Did write some code to flash a RGB led, ten colours 0-9, flashes out the ip address, only needs three PWMs on GPIO pins.

Will need to look at the thread examples soon.
Current piCore boxes log sensor data to files via cron, runs a busybox-httpd webserver and a ModbusTCP server.
Multitasking piCore Linux can do this and editing/updatng code while running remotely, but takes lots of files and maybe 50-100MBs.
Started with Raspbian and 4GB 4yrs ago. Doing it now with Ultibo <10Mb?

Need to get my head around how Ultibo does thread/multicore stuff.

I did see SMTP is on your done list, I will need to test sending alarm emails too.
And a config.ini file for the editable settings, email addresses, alarrn set points etc.

A simple file editor in shell? add that to Feature request :idea:

How do you know you are on the bleeding edge?
When you do a google search and find yourself in the top 5 :ugeek:
Pack bandaids.

Hanging out, waiting for my first Pi Zero's to arrive, network over serial/RS485, PPP?
$5 IoT gadgets? yes please 8-)
Zero + LoRa + Ultibo = Long range Wireless IoT

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 9 guests