Weekend of code enhancements

The temperature is getting low, and after spending most of saturday getting numb fingers and feet whilst working on R2’s center foot, I decided to do some much warmer work in the office and do some code enhancements.

  1. Telegram Bot
  2. i2c Monitoring
  3. Drinks Mixer

Telegram Bot

Telegram is a communication system that I already use for my home automation, so figured it might be handy for R2 to use it to. Not many functions added yet, just some simple volume and sound commands, but the main function is the /status command.

Current Status
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Uptime: 14:26:25.870000
Main Battery: 24.865 (balance: 0.011)
Remote Battery: 
Wifi: 
Internet: True 
Location: 
Volume: 0.296875
--------------
Scripts Running:

Still some clean up needed, but gives a good way of checking various stats.

i2c Monitoring

This is something I’ve been wanting to add for a while, and have had the circuit and basic arduino code done already. It is all now tied into r2_control and so current draw and battery status (current voltage and max cell difference) can now be queried. Not only that, if logging is enabled then it will also log to a file twice a second (configurable) as a csv. This means it can be imported into a spreadsheet and graphed so I can see power draw throughout the day.

As can be seen above, the details can also be retrieved using the telegram bot and /status.

Drinks Mixer

Not so much part of R2 exactly, but it will be going into him. The plan is to have a few reservoirs, some pumps, and some control circuit to allow drinks to be mixed and poured.

A base outline of code is now done, which will take in an array of substances and amounts, and turn a set of i2c controlled motors on and off for the desired duration. Still lots to do on this, not least of which is to get a working circuit done, and a decent web interface, etc. But its a start.

Summary

So, all in all I’m rather happy with a mega weekend of hacking at R2. May try to get out to the garage one evening this week to do some more work on his center foot. I’d like to have it ready for the midnight premier of The Last Jedi that I’m attending. Trouble is, the garage is currently sat at around 4.5C.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.