Close

Added More Commands to TRILLSAT-1

A project log for Tethered Haptics Using Morse Pulses

Waves of Dits and Dahs in a Tether Sea

lee-djavaherianLee Djavaherian 08/17/2018 at 20:230 Comments

Even though THUMP is now installed and working in the #TrillSat project, I need it to actually do something useful, and so I'm adding more commands to my TRILLSAT-1 prototype.  On trillsat_bot.py, I've created a series of XMPP commands that I can issue to the ESP8266 (which is sent to the Pi over the UART).

The Pi then sends I2C commands to the LIS3DH so that I can change its parameters on-the-fly for testing:

cfg [0-255]     Set CLICK_CFG register to set click direction (1 is x, 4 is y, 16 is z, add for combos)
ths [0-255]     Set CLICK_THS register to change threshold (for changing the sensitivity)
limit [0-255]   Set TIME_LIMIT register
latency [0-255] Set TIME_LATENCY register (for changing the pulse width)
window [0-255]  Set TIME_WINDOW register

It also sends some I2C commands to the two ATtinys (Sawyer and Huckleberry) which run THUMP and SIMTHEO:

pulse            Instruct Sawyer to send a short haptic motor pulse for testing
pulsemode [1|0]  Set the morse_echo and morse_replay variables differently on the two ATtinys to enable haptic mode (1) or LED mode (0)
thump [1|0]      Turn the THUMP interrupt on or off

And on trillsat.c, I am now assigning commands to the various letters A-Z.  Hopefully 26 letters (plus an optional binary confirmation which allows 52 combinations) will be enough for me, and I won't need to add a second letter.  I can always add a second letter, which will take more time for the user to enter, to raise the number of combinations to 26^2 = 676 (plus that binary confirmation).  This is why Unix-like systems can get away with using so many two-letter commands--there are over 600 from which to choose.

Here are the haptic commands so far (but are tentative until I see how I like it):

X   Disable all power to the craft, including power to the ATtiny itself (if it is night, the craft will then be completely dead)
L   Turn on the ESP8266 (via its LDO regulator)
B   Turn on the 5v boost converter on Batt 2
Q   Turn on the Qi charger (important if the smartphone is dead and needs to charge to regain XMPP control)

I will add more commands later (and experiment with OFF or toggle commands) and release the updates to the TrillSat source code, showing how THUMP is actually working on the prototype.

Discussions