Difference between revisions of "User:Bertrik Sikken"

From RevSpace
Jump to navigation Jump to search
m
(34 intermediate revisions by the same user not shown)
Line 29: Line 29:
 
This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.
 
This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.
  
=== investigate STM32F103 microcontroller ===
+
=== Understand Bluetooth AP ===
The STM32 family of microcontrollers looks quite interesting.
+
I'm trying to understand how to set up a bluetooth AP on a basic Linux system, such that you can connect to it using an Android phone or tablet.
  
You can buy inexpensive [https://nl.aliexpress.com/item/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module/32327927921.html STM32F103] boards with the following functionality:
+
The idea is that there is some kind of useful application running on the Linux system, and that the "app" on the tablet/phone provides the user interface, connecting to the Linux system using REST.
* Cortex M3 processor running at 72 MHz
 
* 64 kB flash, 20 kB RAM
 
* 2x ADC with 1 microsecond conversion time
 
* USB interface
 
  
The plan is to get a bunch of these and play with them, for example see if it is fast enough to sample ultrasonic audio and store it on an sd card (so it can be used as a super cheap bat call recorder).
+
Possible useful links:
 +
* https://www.linux.com/learn/weekend-project-personal-area-networking-bluetooth
 +
* <del>https://www.osnews.com/story/9836/Make_your_Arch_Linux_a_Bluetooth_Access_Point</del>: quite old, uses rfcomm, basically a serial port over bluetooth
 +
* <del>http://bluez.sourceforge.net/contrib/HOWTO-PAN</del>: describes setting up a network using the "pand" utility, can't find that utility
 +
* [http://www.ampedrftech.com/cod.htm bluetooth device class calculator]
 +
* http://blog.fraggod.net/2015/03/28/bluetooth-pan-network-setup-with-bluez-5x.html
 +
* [https://github.com/mk-fg/fgtk/blob/master/bt-pan bt-pan] script as referred by the link above
 +
* [https://www.linuxjournal.com/article/10915 Is Your Personal Area Network Giving You the BlueZ?]
  
See [http://grauonline.de/wordpress/?page_id=1004 this page] for more information on using these in the Arduino environment.
+
My starting point is:
 +
* a Yocto based Linux distribution
 +
* a Linux 4.1 kernel
 +
* Bluez 5
 +
 
 +
Understanding the various Linux drivers and tools in the Linux bluetooth stack
 +
* btusb: the Linux kernel driver module for many USB/bluetooth adapters, 'modprobe'-ing this module also magically takes care of downloading firmware needed
 +
* hciconfig, low-level configuration utility for manipulating a bluetooth controller. A bit like ifconfig, it can bring the interface up or down, set options, etc.
 +
* hcitool, yet another utility to perform low-level bluetooth operations, like querying the name of paired devices
 +
* bluetoothd, the bluetooth daemon
 +
** /etc/bluetooth/main.conf : supposedly (one of) the configuration files for bluetoothd
 +
** bluetoothd can be accessed over DBUS apparently, see [https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc Bluez docs]
 +
* bluetoothctl, a more high-level configuration utility, basically a command line user interface towards bluetoothd as I understand it. 
 +
 
 +
And some acronyms:
 +
* NAP: network access protocol
 +
* PAN: personal area network
 +
* BNEP: bluetooth network encapsulation protocol
 +
 
 +
Getting somewhere: ?
 +
* <pre>dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.NetworkServer1.Register string:'nap' string:'bnep' </pre>
 +
* following this guide on the server-side (requires systemd): https://blind.guru/tag/bluetooth-pan.html#a-bluetooth-pan-access-point-with-systemd
  
 
=== investigate quadcopter remote control ===
 
=== investigate quadcopter remote control ===
Line 49: Line 73:
  
 
I haven't found a good overview of quadcopter remote control protocol specifications yet, there seem to be plenty examples of "here-is-the-code" however.
 
I haven't found a good overview of quadcopter remote control protocol specifications yet, there seem to be plenty examples of "here-is-the-code" however.
 
=== TTN gateway info panel ===
 
Problem: if you're running a gateway for the-things-network (TTN), you can see packets coming in by following the packet forwarder log file, but it gives very limited and rather cryptic information.
 
For example, you don't see which node sent a message, so you have no idea how many unique nodes are sending data through your gateway.
 
 
This idea is about creating a simple info panel that you can run directly on the TTN gateway itself.
 
The plan is to write this in Python.
 
A typical gateway probably already runs some sort of Linux distribution which has the python binaries available or allows them to be installed easily.
 
Using Python also means that you don't need a compiler/Makefile/etc.
 
 
Basic operation of this utility:
 
* the gateway software is configured to send its data not just to TTN but also to the gateway info panel utility (running on "localhost"), using the poly packet forwarder
 
* the utility listens on a specific UDP port, accepting data according to [https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT the Semtech v1 protocol].
 
* it parses the plain JSON metadata (modulation parameters, like frequency, LoRa mode, SF, BW, etc.)
 
* it also parses the payload bytes, part of the payload is not encrypted, so we can extract the message type, device address and sequence number (FCNT).
 
* all incoming packets are shown in a table-like view in the console using the [https://en.wikipedia.org/wiki/Ncurses ncurses] library.
 
 
Initially, the utility will just keep the packets in memory, so it just shows things that happened since you last started it.
 
Later, we can decide to store the data, for example in a database.
 
 
The information shown can be just the incoming messages in order of arrival, one line per message.
 
Alternatively it could show a kind of node-centric view, one line per device with info only on the latest message from that node.
 
  
 
=== mini word clock in dutch ===
 
=== mini word clock in dutch ===
Line 81: Line 83:
 
The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP. The time offset will be fixed to Dutch local time, i.e. GMT+1 taking into account summer time. Summer time will be determined using the general rule "from 2:00 local time on the last sunday of March until 3:00 local time on the last sunday of October".
 
The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP. The time offset will be fixed to Dutch local time, i.e. GMT+1 taking into account summer time. Summer time will be determined using the general rule "from 2:00 local time on the last sunday of March until 3:00 local time on the last sunday of October".
  
=== Inexpensive CO<sub>2</sub> sensor ===
+
Local date calculation:
TODO: move this to its own page.
+
* http://stackoverflow.com/questions/5590429/calculating-daylight-saving-time-from-only-date
 
+
* https://github.com/niekproductions/word-clock
Status: works as a basic MQTT sensor, see topic "bertrik/co2" on test.mosquitto.org
 
 
 
See [https://github.com/bertrik/mhz19 this github repo] for code.
 
 
 
Use the [http://www.winsen-sensor.com/products/ndir-co2-sensor/mh-z19.html MH-Z19] sensor module (about E22,-) to measure the CO<sub>2</sub> concentration and an ESP8266 (like a WeMos D1 mini board) to push the measurement data over the internet to a MQTT server. Possibly I can use [https://www.esp8266.nu/index.php/ESPEasy ESPEasy] which makes configuration easy (through a web interface), I'd have to add support for this particular sensor -> ESPEasy seems pretty complicated to get changes accepted, has existing bugs that are not addressed, probably better to write my own custom code.
 
  
 
=== Understanding LoRa ===
 
=== Understanding LoRa ===
 
Ultimate goal is to create an SDR algorithm to decode LoRa without the need for dedicated LoRa hardware. This could be useful when tracking HABs transmitting LoRa for example. See [[DecodingLora]] and [[EncodingLora]].
 
Ultimate goal is to create an SDR algorithm to decode LoRa without the need for dedicated LoRa hardware. This could be useful when tracking HABs transmitting LoRa for example. See [[DecodingLora]] and [[EncodingLora]].
 +
 +
In particular, I should definitely check out [https://github.com/rpp0/gr-lora this gr-lora project].
 +
Perhaps make it work for decoding balloon telemetry modes.
  
 
=== Cypress PSOC5 ===
 
=== Cypress PSOC5 ===
 
Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See [[RadarOnAStick]].
 
Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See [[RadarOnAStick]].
  
=== Android HabAlert app ===
+
=== Simple Doppler motion sensors ===
see [[HabAlertApp]]
+
You can find basic doppler microwave motion sensors based on a single transistor, with some weird traces on the PCB very cheaply, for example
 
+
* https://www.aliexpress.com/item/RCWL-0516-microwave-radar-sensor-module-Human-body-induction-switch-module-Intelligent-sensor/32708877914.html
=== Inexpensive ultrasonic player ===
 
Bat netting results can be improved by playing back ultrasonic bat calls near the net.
 
This project idea is about creating an inexpensive ultrasonic player by cleverly combining inexpensive sub-modules available already on the market.
 
 
 
The ultrasonic player consists basically of the following parts:
 
# a device to store the bat calls (in wav-format) and playing them back in a particular sequence from storage, like a laptop, tablet or raspberry pi
 
# a device to convert the digital audio into an analog audio signal, like a USB "sound card"
 
# a device to amplify the analog audio signal
 
# a device to reproduce the analog audio signal into actual ultrasonic audio, i.e. a speaker
 
# a case to put everything together
 
# a power supply
 
 
 
Ultrasonic audio from bats can range to well over 100 kHz.
 
Sampling theory says that to reproduce a bandwidth of B Hz, you need a sampling rate of at least 2*B.
 
 
 
An USB sound card supporting 96 kHz playback would allow ultrasonic audio up to 48 kHz to be reproduced, possibly enough for use in a bat lure.
 
A possible inexpensive candidate is [http://nl.aliexpress.com/item/SA9027-ES9023-24BIT-96KHZ-Asynchronous-USB-DAC-HIFI-Sound-Decoder-Case/32552457818.html this ES9023 based USB sound card], costs about E22.-
 
Here's [https://nl.aliexpress.com/item/SA9227-PCM5102A-32BIT-384KHZ-USB-DAC-HIFI-Asynchronous-Decoder/32722112944.html a SA9227+PCM5102 based USB sound card] that appears to be capable of 384 kHz playback at a price of E29,-
 
 
 
To amplify the audio signal, I'm thinking of
 
[http://nl.aliexpress.com/item/Power-Supply-TDA2030-Audio-Amplifier-Board-Module-TDA2030A-6-12V-Single/32652837701.html this TDA2030 based amplifier board], costs about E1,-
 
The TDA2030 is an analog amplifier block. It takes (a minimum) of 12V and can output up to 14W. The datasheet claims it has a power bandwidth of 10 Hz to 140 kHz.
 
  
As a speaker, I'm thinking of this tweeter [http://www.parts-express.com/peerless-by-tymphany-xt25sc90-04-1-dual-ring-radiator-tweeter--264-1014 Vifa/Tymphany XT25SC90-04], costs about E22,-
+
Typically the microwave part of these consists of a single transistor with a rectangular area on one leg and a meandering trace (with lots of vias to the other side) on the other leg.
 +
The output of this circuit seems to go into a chip very much like the ones used in PIR sensors.
  
As a case, I could create a simple box using our laser cutter, with some tie wraps to hold the parts inside the box.
+
See also https://github.com/jdesbonnet/RCWL-0516 for a reverse engineering effort of these doppler radar modules.
  
Power supply:
+
=== Rust ===
* the USB audio card uses USB 5V.
+
Investigate the [https://www.rust-lang.org/en-US/ rust language].
* the amplifier needs 12V
 
Perhaps we can use a switching power supply to create the 12V from the USB 5V?
 
It would be nice if everything could be fed off the USB 5V.
 
Possible candidate: [http://nl.aliexpress.com/item/2PCS-USB-DC-5V-To-12V-Step-up-Module-Converter-2-1x5-5mm-Male-Connector/32703956336.html 5V-to-12V step-up cable], costs about E3,-
 
  
Another [https://nl.aliexpress.com/item/5W-USB-5V-to-12V-DC-DC-Converter-Step-Up-Boost-Module-for-LED-Moter-Wireless/32326312565.html USB 5V to 12V converter], switching at 1MHz.
+
=== ESP32 ===
 +
I have a Wemos "LOLIN32 V1.0.0" ESP32 board, play with it. Discover bluetooth capabilities, low power modes. Compare it with ESP32.
 +
* [https://github.com/wemos/arduino-esp32 ESP32 Arduino page] by Wemos

Revision as of 11:02, 24 May 2017

User info Bertrik Sikken
Name Bertrik Sikken
Nick bertrik
Tagline heb ik niet

You can reach me at bertrik@sikken.nl or bertrik@gmail.com

Studied Electrical Engineering at Twente University.


Main interests:

  • reverse-engineering things (USB stuff, mp3 players), working on http://rockbox.org
  • studying bats and making electronics for recording/listening to bat sounds
  • radio stuff, in particular software-defined radio


Projects I work(ed) on (refresh):

 Project Status
FrontDoorDisplayAbandoned
HabAlertAppAbandoned
ISSOAbandoned
IbmPosDisplayAbandoned
Pico TrackersAbandoned
RadarOnAStickAbandoned
WifiLampAbandoned
A4PaperDispenserCompleted
BuildStatusTrafficLightCompleted
CJMCU-811Completed
CO2MeterHackingCompleted
CrawlSpaceSensorCompleted
DecodingLoraCompleted
DustSensorCompleted
ElectronicLoadCompleted
EspNowSkipCompleted
IntakefancontrollerCompleted
LichtKrantCompleted
LoRaGatewayCompleted
LoraBatBoxCompleted
LoraWanNodeCompleted
MHZ19Completed
MainsFrequencyCompleted
MiniSTM32F103ZECompleted
PowerLightCompleted
RC522HackingCompleted
RevRadioCompleted
STM32Completed
Secure iButtonCompleted
SoilHumiditySensorCompleted
StofAnanasCompleted
StofradarCompleted
TTNHABBridgeCompleted
VINDRIKTNINGCompleted
ZigbeeCoordinatorCompleted
Sensor-data-bridgeCompleted
AntiLostIn progress
AudioMothIn progress
CubeCellIn progress
EspAudioSensorIn progress
Esp32camIn progress
FMCWRadarIn progress
LoRa-E5-miniIn progress
LoraWanDustSensorIn progress
MainsFrequency2.0In progress
Msi2500SDRIn progress
Sim7020In progress
StereoBatRecorderIn progress
UltrasonicPlayerIn progress
EspNowAudioInitializing
... further results


Project ideas

This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.

Understand Bluetooth AP

I'm trying to understand how to set up a bluetooth AP on a basic Linux system, such that you can connect to it using an Android phone or tablet.

The idea is that there is some kind of useful application running on the Linux system, and that the "app" on the tablet/phone provides the user interface, connecting to the Linux system using REST.

Possible useful links:

My starting point is:

  • a Yocto based Linux distribution
  • a Linux 4.1 kernel
  • Bluez 5

Understanding the various Linux drivers and tools in the Linux bluetooth stack

  • btusb: the Linux kernel driver module for many USB/bluetooth adapters, 'modprobe'-ing this module also magically takes care of downloading firmware needed
  • hciconfig, low-level configuration utility for manipulating a bluetooth controller. A bit like ifconfig, it can bring the interface up or down, set options, etc.
  • hcitool, yet another utility to perform low-level bluetooth operations, like querying the name of paired devices
  • bluetoothd, the bluetooth daemon
    • /etc/bluetooth/main.conf : supposedly (one of) the configuration files for bluetoothd
    • bluetoothd can be accessed over DBUS apparently, see Bluez docs
  • bluetoothctl, a more high-level configuration utility, basically a command line user interface towards bluetoothd as I understand it.

And some acronyms:

  • NAP: network access protocol
  • PAN: personal area network
  • BNEP: bluetooth network encapsulation protocol

Getting somewhere: ?

investigate quadcopter remote control

It turns out that the typical little cheap Chinese quadcopters use a remote-control protocol that can be easily recreated using the famous NRF24L01+ chip (< $1 and easily connected to an arduino). This gives nice opportunity to either:

  1. transmit our own control signal, to control a quadcopter from something different than the manual remote control, e.g. automatic control
  2. receive the control signal, so the manual remote control that comes with a quadcopter can be used to steer other things (like a model car).

I haven't found a good overview of quadcopter remote control protocol specifications yet, there seem to be plenty examples of "here-is-the-code" however.

mini word clock in dutch

Basically an monochrome 8x8 word clock, in Dutch, showing local time in the Netherlands.

This git repo has the current code.

See here for a demo running on an arduino nano.

The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP. The time offset will be fixed to Dutch local time, i.e. GMT+1 taking into account summer time. Summer time will be determined using the general rule "from 2:00 local time on the last sunday of March until 3:00 local time on the last sunday of October".

Local date calculation:

Understanding LoRa

Ultimate goal is to create an SDR algorithm to decode LoRa without the need for dedicated LoRa hardware. This could be useful when tracking HABs transmitting LoRa for example. See DecodingLora and EncodingLora.

In particular, I should definitely check out this gr-lora project. Perhaps make it work for decoding balloon telemetry modes.

Cypress PSOC5

Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See RadarOnAStick.

Simple Doppler motion sensors

You can find basic doppler microwave motion sensors based on a single transistor, with some weird traces on the PCB very cheaply, for example

Typically the microwave part of these consists of a single transistor with a rectangular area on one leg and a meandering trace (with lots of vias to the other side) on the other leg. The output of this circuit seems to go into a chip very much like the ones used in PIR sensors.

See also https://github.com/jdesbonnet/RCWL-0516 for a reverse engineering effort of these doppler radar modules.

Rust

Investigate the rust language.

ESP32

I have a Wemos "LOLIN32 V1.0.0" ESP32 board, play with it. Discover bluetooth capabilities, low power modes. Compare it with ESP32.