/mwc_demo

Code for Mobile World Congress 2022 demo with ZARIOT

Primary LanguageDartBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

GitHub License OpenSSF Scorecard

Mobile World Congress Demo

This repo holds the files for Atsign and Zariot demo for MWC 2022 and IoTExpo 2022.

For background take a look at the press release and the white paper Flipping The Internet of Things (IoT).

There's a short video overview followed by some Q&A in this episode of Flutter Humpday.

The Data Ownership model

at_cli

A simple script to use the at_cli tool to read from MQTT and send updates to an Atsign.

This is no longer used in the demo, but left in place as an example.

dart/iot_sender - iot_sender

A dart app to read from MQTT and send to an Atsign.

First put the sending atSign .atKeys file in ~/.atsign/keys. If you do not have the .atKeys file then register an atSign in an Atsign app and save your keys this will give you the needed key file.

cd dart/iot_sender
dart pub get
dart run ./bin/iot_sender.dart -a "@sendingatsign" -o "@receivingatsign"

When the sender is going to be used repeatedly it should be compiled:

cd dart/iot_sender
dart pub get
dart compile exe ./bin/iot_sender.dart -o sender

The systemd units expect to find a compiled sender binary.

dart/iot_sender - iot_sensor_publisher

A dart app to read from the MAX30101 sensor and place values onto MQTT topics.

cd dart/iot_sender
dart pub get
dart run ./bin/iot_sensor_publisher.dart

When the publisher is going to be used repeatedly it should be compiled:

cd dart/iot_sender
dart pub get
dart compile exe ./bin/iot_sensor_publisher.dart -o spub

The systemd units expect to find a compiled spub binary.

flutter/iot_receiver

A flutter app to receive data from dart/iot_sender and display it on dials.

To run the Windows version:

cd flutter/iot_receiver
flutter pub get
flutter run -d windows

gsm

Details of using a SIM card to store keys, and config files for ppp connection with the cellular modem.

Of course you'll need a SIM, which can be ordered from ZARIOT's test now page.

python

display_hro2_from_mqtt.py

Reads data from MQTT (sent by spub) and displays it on the local LCD display using pygame.

hrmqttsolcd.py

Reads data from MAX30101 sensor then puts it onto MQTT queue whilst also printing out values to local LCD display using pygame.

This is no longer used, but has been left as an example.

shell

O2sender.sh was used during testing to place O2 values onto an MQTT topic.

systemd

Unit definitions to start the demo as a set of services running in detached GNU screens.

Raspberry Pi setup

Bill of Materials

Software config

Raspberry Pi OS Buster 2021-05-28 is needed for compatibility with the PiTFT HAT. To get it to boot from SSD the /boot/start4*.elf files are needed from a more recent Bullseye image.

raspi-config

Enable SSH, I2C, SPI, Uart (disable console on Uart).

apt packages

sudo apt-get update --allow-releaseinfo-change
sudo apt-get upgrade -y
sudo apt install i2c-tools git python3-pip curl libsdl2-mixer-2.0-0 \
  libsdl2-image-2.0-0 libsdl2-2.0-0 libgles2-mesa-dev libsdl2-ttf-2.0-0 \
  mosquitto mosquitto-clients minicom jq screen ppp

pip3 packages

sudo pip3 install smbus max30105 smbus2 pygame paho-mqtt i2cdevice
sudo pip3 install --upgrade adafruit-python-shell click

TFT HAT easy install

The resultant config in /boot/config.txt is something like:

# --- added by adafruit-pitft-helper Tue Feb  8 14:31:08 2022 ---
#hdmi_force_hotplug=0
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28-resistive,rotate=270,speed=64000000,fps=30
# --- end adafruit-pitft-helper Tue Feb  8 14:31:08 2022 ---

Also add these lines to avoid console being shown on TFT and hogging framebuffer device when no HDMI monitor is connected:

hdmi_force_hotplug=1
hdmi_drive=2

install Dart

From the Dart SDK archive:
Stable channel : Linux : Armv7