Tweets
Replying to @heyitry and @suedeyloh
I’d love to tweetstorm about this, but maybe it would make a better blog post. I need to figure out my blogging situation, or maybe just save it as a project update for the Crowd Supply campaign. Some definite lessons learned.
(original)
because I’d like a ritual, but i have too much on my plate to act with any sense of intentionality, I’m going to do an Advent Calendar of Whatever the Hell I’m Up To Every Day. catching up:
Day 1: went to the dentist.
Day 2: Sensor Watch accelerometer stuff.
Day 3: flew to texas.(original)
between the 3am arrival in texas, the red eye back to new york on monday, and the road trip back to texas in approximately 150 hours, i think it’s safe to say i miscalculated my holiday travel plans 🙃
(original)
Replying to @josecastillo
Total side note: now that I have true random number generator support and an (optional) accelerometer, I should add a dice rolling watch face. The F-91W has six digits on the bottom row, so you could roll 6d6 or 3d20 with one flick of the wrist.
(original)
Replying to @bencpye
Do it! There’ll be new things to think about once you have a first rev in hand :)
(original)
Replying to @theavalkyrie
Thank you immensely for sharing your process, your learnings, and your vision; I feel lucky to ride the wake of the currents you’re sending into the world.
(original)
Replying to @theavalkyrie
This means a lot: partly because you’re such a constant inspiration, but also because I learned so much of this from you! To take one small example, I was sleeping on the watch’s ADC until your blog posts teaching ADC superpowers, and now it’s 90% of my excitement for the gadget.
(original)
Replying to @theavalkyrie
❤️❤️❤️
(original)
Replying to @NorthAllenPoole
Oh hell yeah, absolutely! This one traces all the way back to when I first saw @travisgoodspeed’s GoodWatch and thought, “well that’s rad. but in a million years I could never…” https://github.com/travisgoodspeed/goodwatch/
(original)
Replying to @NorthAllenPoole
I know I’m cribbing this from someone, but: “to fuck around is human; to find out is divine.”
(original)
Replying to @josecastillo
But thing of it is: that’s exactly what past-joey did. He searched and he copied and pasted, and in the process of doing that, he learned.
IDK. Point of the thread: there’s no shame in not knowing, because not knowing is always the first step toward finding out. 4/4(original)
Replying to @josecastillo
ANYWAY: in the end i don’t think this was hard or anything, and yet: if you’d asked year-ago-joey to do this, I sense he’d have issues. I distinctly remember not understanding how words in a data sheet translated into code that could do things. He’dve searched Stack Overflow. 3/4
(original)
Replying to @josecastillo
Is it the best code that ever was? ¯\_(ツ)_/¯
Does it fill a buffer with values from a TRNG that passes NIST standard tests for true random number generation? I mean I hope it does; I’d hate to have spent all this time learning and still suck at all this… https://github.com/joeycastillo/Sensor-Watch/commit/bbd394a19aaa334a179c36cf2ed2a066f1bb312c(original)
Tonight feels like a milestone. A year ago I didn’t know how to write firmware outside of Arduino setup/loop functions. Tonight, on a plane without wifi, armed with nothing but a data sheet and a man page, I added hardware random number generator support to the watch library. 1/4
(original)
Replying to @josecastillo
I don’t mean to sound defeatist, and I’m not. Because there have been periods of time when it got better, when we all got on board and turned out overwhelmingly. But my god, if we’d pulled a 2008 in 2016 (and on paper we could have!), my god, how different the country would look.
(original)
Replying to @josecastillo
it’s maddening.
(original)
They don’t have to have an agenda because there’s nothing left. They set out to destroy the safety net and cut taxes on the rich and they did it. At SCOTUS this week they’re on the cusp of the last win they hadn’t already notched, despite winning the popular vote once since 1988. https://twitter.com/jonathanvswan/status/1466580271671611392
(original)
Replying to @dansitu
the thing that really gets me is, given how fundamentally don’t understand this mechanism, I wonder if we’ve done it already by accident. the brain is all complex electrical signals. so is your smartphone. like, it sounds woo woo, but: is the internet conscious?
does it hate us?(original)
this is not 💯 yet, but I think it’s a reasonable amount of win for day five of attempting to build a fitness tracker.
(original)
RT @MLKessel: Not only is today’s date a palindrome, it’s also an ambigram. You can read it left to right, right to left, and also upside d…
(original)
Replying to @josecastillo
the fun part about doing this all open source is, I can tweet from the R&D lab, and anyone can crib from my notes. The technique I’m playing with should work with an Adafruit LIS3DH breakout (it’s just a more full-featured version of the LIS2DH I’m using): https://github.com/joeycastillo/Sensor-Watch/blob/8723c70033b8b62151a7fd25a7671ff2359b9d88/movement/watch_faces/demos/lis2dh_logging_face.c#L34
(original)
Replying to @josecastillo
findings from a night’s sleep: my god, can it really be this easy? Plotted interrupt counts from overnight, and the data I captured tracks cleanly with the periods of restlessness that Autosleep reports. I’m going to start capturing this in quarter hour buckets; this is too good.
(original)
Replying to @enasdhuhri
this! Plus an experimental accessory board with an LIS2DH accelerometer. https://www.crowdsupply.com/oddly-specific-objects/sensor-watch
(original)
findings from a morning run: tracking up to 60 motion events a minute, vigorous exercise fills just about every bucket; 8/56/60 is the last two minutes of my run and walking upstairs. Also: out of a max of 3600 interrupts in the last hour, my 30 minute run triggered 1820 of them.
(original)
Replying to @DavidGlaude
Basically it mostly comes down to the LCD arrangement: if it’s the same shape and size, says F-91W, and it has this *exact* LCD layout, odds are it’s the same movement inside and the same LCD and it will work. Tho I do want to test with more of them to be abundantly sure :)
(original)
Replying to @DavidGlaude
If you press all three buttons at the same time, you can get all the segments to turn on (this is a behavior they copied diligently). If you look closely at the top left digit of the day, the real one’s E, F and G segments are flush, whereas the fake one leaves an unsightly gap…
(original)
Replying to @DavidGlaude
The fakes do not work; the LCD pinout is all wrong. So far I’ve only come across one, and it was surprisingly thorough, but there are a couple of tells. The microprinted U at the bottom right was the wrong size, and the build quality was poorer, but the main thing is on the LCD…
(original)
Replying to @DavidGlaude
I’ve had 100% positive experiences buying from this seller on eBay. I’ve tested with the classic one, the F91WM-7A, the F91WM-1B, and that vintage one (tho I haven’t done as much testing on the vintage ones, I get the sense this design hasn’t changed much) https://www.ebay.com/sch/i.html?_nkw=F91W+F91WS+F91WM&_in_kw=2&_ex_kw=&_sacat=0&_udlo=&_udhi=&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_sadis=15&_stpos=11211-7483&_sargn=-1%26saslc%3D1&_salic=1&_fss=1&_fsradio=%26LH_SpecificSeller%3D1&_saslop=1&_sasl=thecasiostore&_sop=12&_dmd=1&_ipg=50&_fosrp=1
(original)
Replying to @DavidGlaude
So far everything (non-counterfeit) that I’ve tested has worked. Literally every one that says F-91W has used the same internal parts, same geometry and LCD pinout, and has been compatible with this mod. One gold vintage one had an LCD in two pieces, but it was still compatible…
(original)
had a very code kind of day, so I’m having a very spreadsheet kind of night. somehow it always balances out.
(original)
Replying to @josecastillo
ANYWAY. The plan! Gonna wear this for a couple of days alongside an apple watch and see how well my interrupt count correlates with its sense of my activity level. Still lots of parameters I could tweak: acceleration threshold, duration, which axes we actually want to monitor? 🤔
(original)
Replying to @josecastillo
(the upside down A is an X, to distinguish it from an H on the 7-segment display. you have to want it. like, imagine starting at the top, and drawing an X without lifting your pen)
(original)
Day four with the accelerometer board: I have a watch face! Checks the interrupt pin each second and lights up each axis where we moved. The bottom area counts interrupts for each of the last 3 minutes, and there’s a log of interrupts per hour for the last 24 hours. It’s a start!
(original)
Replying to @josecastillo
This could be optimized further; 90% of the time it’s 7 ticks, so we’re burning one extra calculation most of the time to catch that occasional six-tick update. But I know my floor is about 34.5 µA, and sometimes good enough is good enough when you have a lot of other priorities.
(original)
Update: moving from floating point to integer math got the beats face from 50µA to ~44. From there I figured we only update every 6th or 7th tick, so we can skip the math most ticks. Now we’re below 36µA! The graph looks like this; most seconds we do 2 calculations, sometimes 1. https://twitter.com/josecastillo/status/1465760613825748995
(original)
Replying to @snappercayt
It’s custom, a prototype; I had it made for this dev board (tho I hope to make more!)
(original)
Replying to @josecastillo
one thing I love about this project is how the answer to the prompt isn’t always about knowing the right incantation to lob at a register. it often involves thinking about the problem from another angle and figuring out where you can do more with less, or what you can do without.
(original)
Replying to @josecastillo
or better: wake from deep sleep (screen off) to shallow sleep (screen on) immediately. basically let the accelerometer wake us fast when the user puts on the watch, but cut back to no more than one wake per second once on wrist. try to do the least we can while staying responsive
(original)
Replying to @josecastillo
this could even work in sleep mode, where we’re ticking once a minute. If the interrupt pin polls consistently low over the course of several minutes, odds are we’re off-wrist and can go into deep sleep. As soon as the pin goes high though, we can wake up on the next minute mark.
(original)
Replying to @josecastillo
ok. Thinking on it some more now (and I’ve lost the thread, I know), I don’t need to constantly get interrupts for motion. I can have it latch and then just check the pin state whenever the watch ticks. Moved this second? Cool, track that, reset the pin, check again next second…
(original)
Replying to @josecastillo
After a day of pacing, here’s where I’m at. In big digits, the watch face counts accelerometer interrupts in the last 30 seconds; then it moves them to the right side & starts counting again. Will at least give me a real-time sense of how an activity level relates to a datapoint.
(original)
Replying to @josecastillo
for now though I think I need to commit these learnings to the repo, get a watch face going that can count up interrupt events, and start generating some motion data.
(original)
Replying to @josecastillo
the thing I’m very interested in: the SAM L22 has a subsystem called the Event System that can hook 2 peripherals together without any CPU intervention. I’m not there yet, but: it would be v cool for the accelerometer interrupt to trigger an event that increments a timer/counter.
(original)
Replying to @josecastillo
this is sensing at 10Hz, which the LIS2DH data sheet suggests will consume a steady 4µA of power. yay! But each of these interrupts will wake up the CPU, and even if it’s for a fraction of a second to increment a counter, that’s a very brief pulse where we’ll use more power. boo.
(original)
Replying to @josecastillo
now that interrupts are working this is quite promising. not gonna bore y’all with videos of me pacing around the shop, but: with a threshold of 1.5g on any axis, I generate about 50 motion events a minute while walking around, twice that at a jog, and almost none while tweeting.
(original)
things that I love: hunting for an utterly incomprehensible bug all afternoon, only to eventually trace it to one line deep in what was once an automatically generated configuration file, and there finding a comment:
// my god this is a hack. - joey(original)
Replying to @cabe_bedlam
I think the first step may be to change this to integer math; I sense that the problem may feel more well-defined once everything’s being calculated in millibeats.
(original)
Replying to @cabe_bedlam
In essence this is what we need to do; the problem is, to have millis we’d need to let the CPU run, which uses 300µA. instead to stay low power, we’re having the RTC wake us every 125ms, but a centibeat is 864ms, so it doesn’t divide evenly (864/125 = an update every 6.912 ticks)
(original)
Replying to @josecastillo
Ugly things: there is still a pesky bug of some sort in the settings screen. It should be consuming the same amount of power as the Time Set screen, but it’s consuming almost three times as much. this causes me pain and as such it will be going onto the list.
(original)
Replying to @josecastillo
Bad things: I added 8 Hz updates to the beat time face without fully thinking through it, and eight floating point calculations per second is chewing through 50 µA (even though seven of those calculations yield the same result on screen). There is room for optimization here.
(original)