TiLDA MK4: Difference between revisions

From EMF Badge
Jump to navigation Jump to search
(Created page with "Coming soon")
 
No edit summary
 
(45 intermediate revisions by 19 users not shown)
Line 1: Line 1:
Coming soon
[[File:TiLDA_Mk4_Front_with_sponsors.png|right|500px|TiLDA Mk𝛿]]
 
== Using your badge ==
 
<div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px;"><strong>If you just got your badge and it doesn't do anything</strong>, don't despair, quite a few of them need to be [[TiLDA_MK4/reset|factory reset]] before showing the loading screen. Press and hold <code>MENU</code> while quickly pressing the reset button at the back. Keep the <code>MENU</code> button hold for another 2 seconds. Release it when both the red and green LED are lit. If you got it correct both LEDs should flash a few times.<br>If this doesn't work you can [[TiLDA_MK4/Firmware_Update|update the badge firmware]]. If this doesn't work, please come and join us in #emfcamp-badge on [https://libera.chat/ Libera IRC]</div>
 
=== Updating your badge firmware ===
After (and during!) EMF the badge firmware was substantially fixed and improved, resolving issues with call handling and apps.
 
Please update your badge firmware as soon as possible. You can find [[TiLDA_MK4/Firmware_Update|documentation on this here]].
 
=== Assembly ===
With your badge you will receive a booklet explaining how it's done. If you have any problems, please come to the Badge Operation Center and we will help you.<br>
Booklet can be found [https://archive.org/details/emf2018_badge_guide here]
 
=== Basic usage ===
After you have assembled your badge you can just use the tiny switch at the bottom of the screen to turn your badge on. Alternatively you can use any USB power source. If you turn your badge on for the first time (or if for some reason it has reset itself) you will get some on-screen information while we try to download the newest set of software. '''This doesn't always work on the first try, you might have to use "reset" to try a few times'''
 
If at any point you want to restart your badge you can just press the reset button on the back below the display ribbon.
 
==== Changing your name ====
 
# Press 'Menu'
# Select the 'Settings" app
# "Change Name" and press 'A'
# Use the joystick and 'A' key to enter your name
# Press 'Menu' to save your name and reset the badge - your name should now be displayed!
 
==== Installing new apps ====
 
# Press 'Menu'
# Select 'Badge Store' app and press 'A'
# Select "Install"
# Select a category and then an app. Wait until you see the description and press "A" to save it.
# Press B a few times (or alternatively MENU) to restart your badge
# On the home screen you can now press MENU to find your newly installed app.
 
=== WiFi ===
Your TiLDA Badge has built-in wifi support. It should all just work if you're at the campsite, but if you're on your own network you might have to tell the badge about it. For more information please have a look here: [[TiLDA MK4/wifi|WiFi]]
 
=== Charging ===
The badge charges via a microUSB socket, and takes about 2-3 hours for a full charge. The red charge LED to the right of the display ribbon on the back will extinguish when charging is complete.
 
=== Calling and SMS ===
 
'''Warning: The badge team are aware of an issue of instability while using the calling capability. Please bear with us while we diagnose this.'''
 
Yes your TiLDA Badge is also a mobile phone. To connect to the EMF mobile network insert the Hologram SIM supplied, load the "phone" app, select "Select Operator", wait, wait some more, and a little longer, then select "EMF" or "23404". Select "Auto" to use a public mobile network again.
 
To find out your number on the EMF network select "Information" in the phone app. If "Operator" is not shown on the information screen then you have failed to connect to the network. If you are not given a number then wait a little longer and try again. You can read and send SMS messages with the "sms" app. You can also answer calls by pressing "Call" in any app, and end or reject a call using the "End" button at any time.
 
<Radiocode> The cellular part of the badge seems to work (reliably) perfectly if an external antenna is used, such as a mag-mount with a length of coax. Seems to be an EMC issue, as using the pictured right angle antenna directly on the SMA does not work reliably.  Time to get the Kapton tape and copper foil out...
 
[[File:GSM Antenna.jpg]]
 
=== Connecting over USB ===
By default, the software is in a loop. If you want to interact over the REPL you need to exit this. The easiest way is to press Ctrl-C.
 
It's hard to press Ctrl-C in minicom, so on Linux this is easier to do with screen:
<pre>
screen /dev/ttyACM0 115200
</pre>
 
If you can connect but Ctrl-C has no effect then it is possible that another service on your machine is accessing the tty before you can connect. A likely candidate is modemmanager. You can check if ModemManager is running using:
 
<pre>
systemctl | grep -i modem
</pre>
 
and can be stopped with:
 
<pre>
systemctl stop ModemManager.service
</pre>
 
On Mac:
<pre>
screen /dev/tty.usbmodemTiLDA2
</pre>
 
To exit screen, press Ctrl-A, then k, then y.
 
On Windows:
# If you don't have PuTTY or a similar program, get PuTTY installer from [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html]
# Open PuTTY and select Serial connection
# Change COM1 to the COM port for your badge (You can usually find this as USB Seiral Port under ports in device manager)
<font color="#606060"><i>Note: if your badge resets while putty is open, you will have to close the window and open a new connection to the same COM port.</i></font>
 
The basic process is this:
 
# Connect device to computer with usb
# Fire up minicom or screen
# Press reset button on device
# Hit Ctrl+C quickly and with vigour to get to the REPL before the UI comes up
 
=== Nothing works! Help! ===
 
Don't worry, you can always "factory reset" your badge. Please follow these instructions: [[TiLDA_MK4/reset|Resetting]]
 
If everything else absolutely fails, you can try following these instructions (advanced): [[TiLDA_MK4/Firmware_Update]]
 
== Hacking your badge ==
 
=== App Hack ===
 
'''[https://gist.github.com/SteveAmor/8c333927fded2339da54ad4aaa765d7e A method to hack your app onto your badge]'''
 
=== Tilda Tools ===
 
 
'''[[TiLDA_MK4/tilda-tools|tilda-tools]]''' - Should now work on Windows, Linux and OSX
 
=== OSX ===
 
Mass storage now works on OSX
 
 
'''[[TiLDA_MK4/Introduction_to_badge_hacking|Badge Hacking Workshop Documentation]]'''
 
 
One of the main goals of TiLDA is to make hacking it as easy as possible. All you need to do so is a computer with USB and your badge.
 
* '''[[TiLDA_MK4/tilda-tools|tilda-tools]]''' - the one-stop interface for all your badge needs
* '''[[TiLDA MK4/Get Started|Step-by-step]]''' - to make it as easy as possible to get going
* '''[[TiLDA MK4/Run Code|3 Ways to run code on your TiLDA]]'''
* '''[[TiLDA MK4/Badge Store Submissions|Badge Store Submissions]]''' - Share your creations with others
* '''[[TiLDA MK4/Code Structure|Code Structure]]''' - How the python code is structured
 
The badge itself runs code written in the computer language [https://en.wikipedia.org/wiki/Python_(programming_language) Python] which is run by a bit of software called [https://micropython.org/ Micropython].
 
For more information about the functions available please have a look at the [[#Badge API|Badge API]] section of this page.
 
In case you're more interested in what makes the hardware tick and your confident with C++ and microprocessors then you can work directly with the micropython code that runs TiLDA: [[TiLDA MK4/build|How to build the firmware from scratch]]
 
All code used is hosted on Github. Contributions and PR are very welcome!
* https://github.com/emfcamp/Mk4-Apps
* https://github.com/emfcamp/Mk4-Backend (powers the badge store)
* https://github.com/emfcamp/Mk4-micropython-board
 
=== Building Micropython Firmware ===
[[TiLDA_MK4/BuildingFirmware|Build Instructions]]
 
=== Some ideas ===
 
[[TiLDA MK4/Ideas|Please share what you've done (or want to do) with others!]]
 
Tips by Ben Woodley (Tested on Ubuntu 18.04 and Debian Stretch)
 
'''If you're having issues with getting the python prompt while using a serial terminal or the tilda_tools is failing'''
Error displayed: SerialTimeoutException: Write Timeout
Fix:
* Do this command (ModemManager steals your escape characters!)
* $ sudo systemctl stop ModemManager.service
* Then make sure your badge is in an app (anything but the purple home screen)
* Try open a serial terminal with the device (e.g. screen /dev/ttyACM0 115200)
* The issue should not persist
 
'''Reflash the firmware'''
* If lets say you wanted to '''force a firmware update to apply the patch for making phone calls''' then just follow these steps.
* $ git clone https://github.com/micropython/micropython.git
* $ cd micropython/ports
* $ git clone https://github.com/emfcamp/Mk4-micropython-board.git
* $ cd Mk4-micropython-board
* $ ./inst_tools
* $ make
* You may need additional packages depending on your distro, follow the errors if encountered with inst_tools or make.
* Put the badge in DFU mode (press and hold the centre button of the joystick and press reset button, let go of joystick after a second)
* $ make flash-dfu
* This will reflash the firmware, if it fails your board is either not in dfu mode or you need additional packages (like python3-serial in apt!)
 
'''Using the Grove Serial connector'''
 
<Radiocode>
The Badge Team thoughtfully chose to include a couple of Seeed Studio Grove system connectors to the 2018 badge. Looking at the rear of the badge,
they are either side of the unpopulated 3.5mm jack footprint, top right.
*On the left is the Grove I2C connector <anyone using this?>
*On the right is the Grove UART connector
The Grove UART is helpfully labelled "UART4". To use it in Python, it is actually number 2!!!
 
Example:
 
import machine
 
u = machine.UART(2, 9600)
 
g = u.readline()
 
etc...
 
can be used to communicate with the Seeed Studio GPS module. [Seeed Studio: http://wiki.seeedstudio.com/Grove-GPS/]
 
== Badge API ==
 
=== Build-in ===
* [http://docs.micropython.org/en/latest/pyboard/ documentation] - General Micropython libarary
* [[TiLDA MK4/ugfx|uGFX]] - The TiLDA LCD colour screen
* [[TiLDA MK4/documentation/cc3100|CC3100]] - The wifi chip
* [[TiLDA MK4/rtc|RTC]] (real time clock)
* [[TiLDA MK4/sensors|Sensors]]
* [[TiLDA MK4/sim800|SIM800]] (GSM/Phone/Bluetooth)
* [[TiLDA MK4/modtilda|import tilda]] (our custom micropython module)
* [[TiLDA MK4/spi|SPI]] SPI
* [[TiLDA MK4/Neopix|Neopix]] WS2812B LEDs
* please add
 
=== TiLDA Libraries ===
On top of the build-in modules above we have also created a bunch of helpful libraries written in python. If you go through the bootstrap process or use the App Library you should always have a full set of those on your badge. If for some reason this isn't the case you can download our repository from https://github.com/emfcamp/Mk4-Firmware and copy the <code>lib</code> folder onto your badge.
 
for now please have a look at the libraries themselves: https://github.com/emfcamp/Mk4-Apps/tree/master/lib
 
(feel free to add additional ideas, and create links new wiki pages to on-going projects, perhaps someone will want to contribute)
 
=== Hardware ===
 
Full hardware files are on GitHub [https://github.com/emfcamp/Mk4-Hardware]
 
== Badge hardware ==
 
TiLDA comes with a long list of very useful hardware. Some might be obvious, but some are a bit hidden.
* Texas Instruments [http://www.ti.com/product/MSP432E401Y MSP432E4 SimpleLink Microcontroller] (ARM Cortex-M4F @ 120MHz)
* Texas Instruments [http://www.ti.com/product/CC3120 CC3120 SimpleLink Wi-Fi® Network Processor]
* 256KB internal RAM / 8MB external SDRAM
* 1MB internal flash (firmware) / 1MB external flash (filesystem)
* [https://simcom.ee/modules/gsm-gprs/sim800c/ SIM800 Quad-band GSM/GPRS module] with Bluetooth support
* [https://cdn.hackaday.io/files/11178478239552/ER-TFT024-3_Datasheet.pdf 240x320 RGB screen]
* 2 [https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf WS2812B RGB LEDs] (aka Neopixels) with a 3-pin header to connect your own (And this year they’re the right way up!)
* Texas Instruments [http://www.ti.com/lit/ds/symlink/hdc2080.pdf HDC2080 Low Power Humidity and Temperature Sensor]
* Texas Instruments [http://www.ti.com/lit/ds/symlink/tmp102.pdf TMP102 Digital Temperature Sensor]
* Texas Instruments [http://www.ti.com/lit/ds/symlink/opt3001.pdf OPT3001 Digital Ambient Light Sensor]
* Texas Instruments [http://www.ti.com/lit/ds/symlink/drv5055.pdf DRV5055 High Accuracy Bipolar Hall Effect Sensor]
* Speaker and Microphone
* 2000mAh Battery
* Onboard Ethernet (requires breakout)
* A [https://en.wikipedia.org/wiki/T9_(predictive_text) T9] number keypad and a joystick
* 2 [http://wiki.seeedstudio.com/Grove_System/ Seed Studio Grove headers] (one UART, one I²C)
* [https://learn.sparkfun.com/tutorials/sewing-with-conductive-thread Conductive thread] points and 0.1" header for power/UART/I2C/GPIO
* [https://hackaday.io/project/52950-defcon-26-shitty-add-ons Defcon 26 Shitty Add-Ons connector]
 
Hardware files are available on GitHub [https://github.com/emfcamp/Mk4-Hardware].
 
[[File:Sensor_graphic_-_with_fixed_transparency-01.png|left|500px|TiLDA Mk𝛿 Back]]
[[File:Sensor_graphic_-_with_fixed_transparency-02.png|left|500px|TiLDA Mk𝛿 Back]]
[[Category: Badges]]

Latest revision as of 09:55, 28 March 2024

TiLDA Mk𝛿

Using your badge

If you just got your badge and it doesn't do anything, don't despair, quite a few of them need to be factory reset before showing the loading screen. Press and hold MENU while quickly pressing the reset button at the back. Keep the MENU button hold for another 2 seconds. Release it when both the red and green LED are lit. If you got it correct both LEDs should flash a few times.
If this doesn't work you can update the badge firmware. If this doesn't work, please come and join us in #emfcamp-badge on Libera IRC

Updating your badge firmware

After (and during!) EMF the badge firmware was substantially fixed and improved, resolving issues with call handling and apps.

Please update your badge firmware as soon as possible. You can find documentation on this here.

Assembly

With your badge you will receive a booklet explaining how it's done. If you have any problems, please come to the Badge Operation Center and we will help you.
Booklet can be found here

Basic usage

After you have assembled your badge you can just use the tiny switch at the bottom of the screen to turn your badge on. Alternatively you can use any USB power source. If you turn your badge on for the first time (or if for some reason it has reset itself) you will get some on-screen information while we try to download the newest set of software. This doesn't always work on the first try, you might have to use "reset" to try a few times

If at any point you want to restart your badge you can just press the reset button on the back below the display ribbon.

Changing your name

  1. Press 'Menu'
  2. Select the 'Settings" app
  3. "Change Name" and press 'A'
  4. Use the joystick and 'A' key to enter your name
  5. Press 'Menu' to save your name and reset the badge - your name should now be displayed!

Installing new apps

  1. Press 'Menu'
  2. Select 'Badge Store' app and press 'A'
  3. Select "Install"
  4. Select a category and then an app. Wait until you see the description and press "A" to save it.
  5. Press B a few times (or alternatively MENU) to restart your badge
  6. On the home screen you can now press MENU to find your newly installed app.

WiFi

Your TiLDA Badge has built-in wifi support. It should all just work if you're at the campsite, but if you're on your own network you might have to tell the badge about it. For more information please have a look here: WiFi

Charging

The badge charges via a microUSB socket, and takes about 2-3 hours for a full charge. The red charge LED to the right of the display ribbon on the back will extinguish when charging is complete.

Calling and SMS

Warning: The badge team are aware of an issue of instability while using the calling capability. Please bear with us while we diagnose this.

Yes your TiLDA Badge is also a mobile phone. To connect to the EMF mobile network insert the Hologram SIM supplied, load the "phone" app, select "Select Operator", wait, wait some more, and a little longer, then select "EMF" or "23404". Select "Auto" to use a public mobile network again.

To find out your number on the EMF network select "Information" in the phone app. If "Operator" is not shown on the information screen then you have failed to connect to the network. If you are not given a number then wait a little longer and try again. You can read and send SMS messages with the "sms" app. You can also answer calls by pressing "Call" in any app, and end or reject a call using the "End" button at any time.

<Radiocode> The cellular part of the badge seems to work (reliably) perfectly if an external antenna is used, such as a mag-mount with a length of coax. Seems to be an EMC issue, as using the pictured right angle antenna directly on the SMA does not work reliably. Time to get the Kapton tape and copper foil out...

GSM Antenna.jpg

Connecting over USB

By default, the software is in a loop. If you want to interact over the REPL you need to exit this. The easiest way is to press Ctrl-C.

It's hard to press Ctrl-C in minicom, so on Linux this is easier to do with screen:

screen /dev/ttyACM0 115200

If you can connect but Ctrl-C has no effect then it is possible that another service on your machine is accessing the tty before you can connect. A likely candidate is modemmanager. You can check if ModemManager is running using:

systemctl | grep -i modem

and can be stopped with:

systemctl stop ModemManager.service

On Mac:

screen /dev/tty.usbmodemTiLDA2

To exit screen, press Ctrl-A, then k, then y.

On Windows:

  1. If you don't have PuTTY or a similar program, get PuTTY installer from [1]
  2. Open PuTTY and select Serial connection
  3. Change COM1 to the COM port for your badge (You can usually find this as USB Seiral Port under ports in device manager)

Note: if your badge resets while putty is open, you will have to close the window and open a new connection to the same COM port.

The basic process is this:

  1. Connect device to computer with usb
  2. Fire up minicom or screen
  3. Press reset button on device
  4. Hit Ctrl+C quickly and with vigour to get to the REPL before the UI comes up

Nothing works! Help!

Don't worry, you can always "factory reset" your badge. Please follow these instructions: Resetting

If everything else absolutely fails, you can try following these instructions (advanced): TiLDA_MK4/Firmware_Update

Hacking your badge

App Hack

A method to hack your app onto your badge

Tilda Tools

tilda-tools - Should now work on Windows, Linux and OSX

OSX

Mass storage now works on OSX


Badge Hacking Workshop Documentation


One of the main goals of TiLDA is to make hacking it as easy as possible. All you need to do so is a computer with USB and your badge.

The badge itself runs code written in the computer language Python which is run by a bit of software called Micropython.

For more information about the functions available please have a look at the Badge API section of this page.

In case you're more interested in what makes the hardware tick and your confident with C++ and microprocessors then you can work directly with the micropython code that runs TiLDA: How to build the firmware from scratch

All code used is hosted on Github. Contributions and PR are very welcome!

Building Micropython Firmware

Build Instructions

Some ideas

Please share what you've done (or want to do) with others!

Tips by Ben Woodley (Tested on Ubuntu 18.04 and Debian Stretch)

If you're having issues with getting the python prompt while using a serial terminal or the tilda_tools is failing Error displayed: SerialTimeoutException: Write Timeout Fix:

  • Do this command (ModemManager steals your escape characters!)
  • $ sudo systemctl stop ModemManager.service
  • Then make sure your badge is in an app (anything but the purple home screen)
  • Try open a serial terminal with the device (e.g. screen /dev/ttyACM0 115200)
  • The issue should not persist

Reflash the firmware

  • If lets say you wanted to force a firmware update to apply the patch for making phone calls then just follow these steps.
  • $ git clone https://github.com/micropython/micropython.git
  • $ cd micropython/ports
  • $ git clone https://github.com/emfcamp/Mk4-micropython-board.git
  • $ cd Mk4-micropython-board
  • $ ./inst_tools
  • $ make
  • You may need additional packages depending on your distro, follow the errors if encountered with inst_tools or make.
  • Put the badge in DFU mode (press and hold the centre button of the joystick and press reset button, let go of joystick after a second)
  • $ make flash-dfu
  • This will reflash the firmware, if it fails your board is either not in dfu mode or you need additional packages (like python3-serial in apt!)

Using the Grove Serial connector

<Radiocode> The Badge Team thoughtfully chose to include a couple of Seeed Studio Grove system connectors to the 2018 badge. Looking at the rear of the badge, they are either side of the unpopulated 3.5mm jack footprint, top right.

  • On the left is the Grove I2C connector <anyone using this?>
  • On the right is the Grove UART connector

The Grove UART is helpfully labelled "UART4". To use it in Python, it is actually number 2!!!

Example:

import machine

u = machine.UART(2, 9600)

g = u.readline()

etc...

can be used to communicate with the Seeed Studio GPS module. [Seeed Studio: http://wiki.seeedstudio.com/Grove-GPS/]

Badge API

Build-in

TiLDA Libraries

On top of the build-in modules above we have also created a bunch of helpful libraries written in python. If you go through the bootstrap process or use the App Library you should always have a full set of those on your badge. If for some reason this isn't the case you can download our repository from https://github.com/emfcamp/Mk4-Firmware and copy the lib folder onto your badge.

for now please have a look at the libraries themselves: https://github.com/emfcamp/Mk4-Apps/tree/master/lib

(feel free to add additional ideas, and create links new wiki pages to on-going projects, perhaps someone will want to contribute)

Hardware

Full hardware files are on GitHub [2]

Badge hardware

TiLDA comes with a long list of very useful hardware. Some might be obvious, but some are a bit hidden.

Hardware files are available on GitHub [3].

TiLDA Mk𝛿 Back
TiLDA Mk𝛿 Back