Physical Web BLE Drone Project

This summer, we at Wireless Trondheim have been working at a Web BLE API drone. The idea was simple: Buy a standard commercially available drone, swap the standard flight controller with a custom one and get it flying.

Our custom nRF52 flight controller
Our custom nRF52 flight controller

The standard drone was a Spedix build kit from makeadrone.net. Our custom flight controller was based on the amazing nRF52 from Nordic Semiconductor. The nRF52 has good support for BLE, and we was in particular interested in Physical Web (eddystone) and BLE Web API.

The BLE Web API opens a whole range of new opportunities for your standard Web browser. This was not even remotely possible before without building a standard app. We thought, why should you buy expensive radio controllers for your RC toys, can’t you just controll them via your phone?

So we made a remote control for our browser using the BLE Web API. The prototype is simple, but it works! We send the standard channels throttle, yaw, pitch and roll to the flight controller. But it is possible to send plenty more data. Not just from the remote controller to the drone, but from the drone to the remote as well. Imaging sending data like battery status, location and all sort of fancy information. The possibilities are there, we are not limited by the 5-6 channels that are usual for most starter RC radios.

Screenshot of BLE Web API drone controller
Screenshot of the BLE Web API drone controller

As for the Physical Web part of the flight controller, we believe there are plenty good reason to put this into a flight controller. One of the key reasons that stop people from building their own drone is that they believe it is too complicated. We ask, why not make it stupid simple? With Physical Web and BLE Web API, it is possible to make a very interactive and simple building guide.

For example, it is very easy for the flight controller to check if everything is connected correct, and it should be even easier for the flight controller to tell the user which cable that aren’t connected as it should via the interactive guide.

Are you interested to see more? Come and see us at Trondheim Maker Faire 26. – 27. August. We will be showcasing the drone, and we’ll be happy to answer all your questions.

Success with LoRa workshop in Trondheim

On Monday 23rd May we organized a LoRa workshop at DIGS. About 20 participants joined the meetup.

The purpose of this 2-hour workshop was to get hands-on experience with using the LoRa network in Trondheim. LoRa is a new radio standard for connecting things to the internet. Its features are long range and low battery. It is useful to power the internet of things.

We had two visitors from Semtech:

Bernt-Olov gave us a small tour of his company and their products.

One interesting fact from Bernt regarding LoRa is that it is very resilient to jammers. The reason is because LoRa uses spread-spectrum techniques in which a particular bandwidth is deliberately spread in the frequency domain.

semtech-bern

We put together a guide over at a Github repository, for the participants to follow: https://github.com/TradloseTrondheim/lora-workshop

At least two groups were able to send data to the network and then fetch it with an MQTT client.

Others struggled with related technological issues.

lora-workshop-digs

In all, a very successful workshop. It feels good to be working with bleeding edge technology.

The natural next step after mastering this technology is to identify areas that can profit from it.

Examples:

  • Measuring air quality
  • Automatic measuring of garbage cans levels
  • Antibike theft
  • Anticar theft
  • Optimized road usage
  • Monitoring of parking spaces
  • Monitoring vibrations in buildings
  • Monitoring traffic congestion. Increase price when it becomes congested.
  • Detecting fire/temperature levels.
  • Measuring radiation levels
  • Animal tracking
  • Home intrusion detection systems

LoRaWAN gateways up and running in Trondheim

lora-logo-transp-400x231

For a few months we have had two lora gateways up and running in Trondheim. One on the roof of olavskvartalet. Its gateway_ID is AA555A0008060353.

Another one is located on the roof of samfundet. Its gateway_ID is AA555A0008060252.
They are both forwarding data packets to The Things Network.

LoRaWAN is a Low Power Wide Area Network (LPWAN) specification intended for wireless battery operated Things. The intention is to provide infrastructure for the internet of things. More and more devices will be connected to the internet.

The gateways are publicly accessible. This means they will accept all packets and ship them off to The Things Network. To grab the data you use the http api.

To understand the data flow and architecture, visit the The Things Network wiki.

Two NTNU students are already using our lora network to measure co2 emissions in Elgeseter gate.

Feel free to contact us at hei@tradlosetrondheim.no if you find this interesting!

Let’s setup MultiConnect Conduit

multiconnect-conduit

The following guide assumes you have basic computer and basic linux knowledge. Hardware required:

  • MTCDT-210L-US-EU-GB Multitech mLinux Conduit (non-cellular)
  • MTAC-LORA-868 accessory card

For console access I plugged into the USB device port behind the device.
To access the device I use minicom(1):

minicom -D /dev/ttyACM0 -b 9600

This gives me the following:

            _     _                  
  _ __ ___ | |   (_)_ __  _   ___  __
 | '_ ` _ \| |   | | '_ \| | | \ \/ /
 | | | | | | |___| | | | | |_| |>  < 
 |_| |_| |_|_____|_|_| |_|\__,_/_/\_\
                                     
MultiTech Systems mLinux GNU/Linux
mLinux 3.1.0 mtcdt /dev/ttyGS0

mtcdt login: 

The username and password is root and root. That should be changed immediately.
I use openssl to produce a password with sufficient entropy:

openssl rand -base64 16

A new root password is set with passwd(1).

The mLinux distribution is based upon busybox, which is a minimal linux environment.

The distro version can be shown with:

cat /etc/mlinux-version

For me it displayed:

cat /etc/mlinux-version
mLinux 3.1.0
Built from branch: (detachedfrom4fd069b)
Revision: 4fd069b97a2354995920b52f731d661f0bacb39a

Network

mLinux has a static IP 192.168.2.1 as defined in /etc/network/interfaces.
A DHCP client is not enabled.

Instead of setting a static IP adress, use DHCP instead. Add the following to /etc/network/interfaces:

auto eth0             
iface eth0 inet dhcp

For changes to take effect issue:

ifdown eth0 && ifup eth0

This gives output:

udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Sending select for 10.9.12.234...
Lease of 10.9.12.234 obtained, lease time 36000
/etc/udhcpc.d/50default: Adding DNS 10.9.0.11
/etc/udhcpc.d/50default: Adding DNS 10.9.0.10

Udhcpc is a very small DHCP client program geared towards embedded systems. If you have control over the DHCP server you can consistently offer a same ip by configuring the MAC address of the device.

Date and time

Set correct timezone:

ln -fs /usr/share/zoneinfo/Europe/Oslo /etc/localtime

Set date and time:

date "2016-03-07 11:17:40"

Update the hardware clock:

hwclock -u -w

Configuring packet forwarder

The lora network server is used if you want to run your own cloud. Since we are using the things network we only really need the packet forwarder to be running.

People have reported that the poly pkt forwarder works better than the basic pkt forwarder. Fetch the poly-packet-forwarder_2.1-r1. Install with:

opkg install poly-packet-forwarder_2.1-r1_arm926ejste.ipk

Change /etc/init.d/lora-network-server so that the variable pkt_fwd
is assigned pkt_fwd=/opt/lora/poly_pkt_fwd

Inside /var/config/lora/global_conf.json you have to add some changes. Here are a few of mine:

"gateway_ID": "008000000000A447",
...
"servers":
        [ { "server_address": "croft.thethings.girovito.nl",
            "serv_port_up": 1700,
            "serv_port_down": 1700,
            "serv_enabled": true }
        ],
...
"fake_gps": true,
 "ref_latitude": 63.43,
 "ref_longitude": 10.40,
...
/* Email of gateway operator, max 40 chars*/
"contact_email": "drift@tradlosetrondheim.no", 
/* Public description of this device, max 64 chars */
"description": "This is wireless trondheims multiconnect conduit number 1" 

Restart network server:

/etc/init.d/lora-network-server restart

Tail log for debug info:

tail -f /var/log/lora-pkt-fwd.log

My gateway is now available at The Things Network.