Having fun with a solar panel, camera and Apache projects.pdf
jfclere
15 views
22 slides
Oct 10, 2024
Slide 1 of 22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
About This Presentation
An Apache Mynewt running on ARM boards mesures temperature, pressure, humidity, report it to Apache ActiveMQ and using grafana to display measures,
Size: 2.91 MB
Language: en
Added: Oct 10, 2024
Slides: 22 pages
Slide Content
Having fun with a solar
panel, camera, sensors
and Apache projects.
Jean-Frederic Clere @jfclere
Agenda
●Introduction.
●How it started...
●Playing with wifi
●Moving to BLE
●Getting started with mynewt (nRF52840, feather nRF52)
●Using Artemis
●Demo
●Q & A
Who I am
●Red Hat employee
−www.redhat.com
●Tomcat / httpd committer
−Tomcat.apache.org /httpd.apache.org
●In Neuchatel Office
How does it started
●Needs of cheap cluster demos (for TomcatCon)
N1 HAT
Server
WIFI
N2 HAT
WIFI
FireFox / Chrome
MASTER
Bare Metal Cloud demo
How does it changed
●Needs of cheap cluster demos (for TomcatCon)
●New RPI4 = update the cluster.
●What to do with the old ones? :)
What happens to the old ones…
RPI3
connected to relay board (hyperion)
connected the switch (manual comment)
connected wifi and internet (remote control)
Using GPIO
Apache HTTPD and cgi python
https://github.com/jfclere/door
What happens to the old ones…
RPI3
windsensor 9V power with USB
mcp3008 to convert the voltage
using SPI
Python script to read SPI and Wifi to the other
RPI3
https://github.com/jfclere/door/blob/master/mc
p3008.py
What happens to the old ones…
RPI3 (well I changed it to a RPIzero W)
Controlled by a server ssh
Use raspberry pi v2 camera
Use BME280 I2C temp/pressure/humidity
https://github.com/jfclere/pisolar/blob/main/b
me280.py
Solar running version
Other fun objects with wifi
RP2040 based there are many
Micropython version for each
Smaller objects arduino nano
Use arduino IDE (ino and cpp)
No CSI so no camera but 3.3V powerable and analogue inputs and
of course GPIO, I2C , SPI and UART.
Real stuff with wifi (arduino nano)
BLE/GATT/BME280
BLE: less energy than Wifi, move sensors in house.
GATT: normalisation, so can work with any central device.
Environment sensor: i2c BME280
Mynewt: because it is Apache.
nRF52840 dongle
nRF52840 DK
Adafruit feather nRF52 Pro with myNewt
nRF52840 dongle with mynewt
-USB DFU bootloader
-hw/bsp/nordic_pca10059
-newt build app (app=your app)
-objectcopy to get a .hex file
-nrfutil pkg generate --hw-version 52 --sd-req 0 .. to get the .hex into a zip package
-nrfutil dfu usb-serial -p dev_usb to flash the app in the device.
-Need flash map in target.yml to be able to use the Nordic bootloader
-Power by USB
-Small and cheap
-Also programmable with JLinkExe (SEGGER or DK with a cable)
-newt create-image app (app=your app)
-newt build dongle_boot (app=@mcuboot/boot/mynewt)
nRF52840 DK with mynewt
-Use JLinkExe and a cable
-TC2050-IDC-NL-050 to Debug Out for the dongle
-hw/bsp/nordic_pca10056 (for on the board Nrf52)
-Power by USB
-Big with many pins for prototyping (uart console)
-Not so cheap
-programmable with JLinkExe
-newt create-image app (app=your app)
-newt build dongle_boot (app=@mcuboot/boot/mynewt)
Adafruit Feather nRF52 with MyNewt
-Use JLinkExe and a cable
-Flat 0.05 10 pins cable to Debug Out for the dongle
-hw/bsp/ada_feather_nrf52
-Power by USB or Lipo (contains a charger for the Lipo)
-Small but with many pins for prototyping (uart console, i2c etc)
-Not as cheap as the dongle
-The MyNewt on board is old, I was NOT able to flash my app.
Collecting the GATT data on raspberry pi.
Use BlueZ from the raspbian OS.
C utility to read the /sys bluetooth file system (Bluez over the DBus)
Write the value in a /tmp file.
Sending to Artemis
Read the file, use Paho to send the data to Artemis.
"mqtts://jfclere.myddns.me:8001"
sprintf(topic,"topic/%s", devicename);
ssl_opts.enableServerCertAuth = false;
ssl_opts.verify = false;
// ssl_opts.trustStore = server_certificate.c_str();
Service waits for messages from Artemis on the server and put the information in
PostgreSQL database
#define ADDRESS "tcp://localhost:1883"
#define TOPIC "topic/#"
Grafana for visualisation just read the database.
Grafana screen
Little more demo on newt
Why newtmgr is so cool (using mynewt-nimble)
newtmgr image upload
newtmgr image list
newtmgr image test
power off/on or newtmgr reset
newtmgr image confirm
Try it yourself
Everything at:
https://github.com/jfclere/bt
Thanks to:
Szymon Janc, Jerzy Kasenberg and many more for the Mynewt slack channel
Ask me: [email protected]
QUESTIONS
THANK YOU!