💾 Archived View for thatit.be › 2024-10-10-13-07-59.gmi captured on 2024-12-17 at 10:03:58. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
It’s October 10ᵗʰ. This was the new release date for Fantasy Life i until it was delayed further. The new-new release date is April 4. I like the 10/10 and 4/4 dates, that’s a nice touch, but since I wont be able to play the new one today, I’ve been playing the old one. Not just today, but for a few weeks now. I’ve managed to get a few Lifes up to Master rank, but my level isn’t high enough to get the Origin Island content unlocked yet.
Other things that have been keeping me busy, aside from Fantasy Life on the 3DS:
With Animal Crossing I deleted my island and started over. I paid off all my loans pretty quickly, (I mailed a bunch of my Bells to other players, and then stashed my remaining balance on a beach to retrieve later,) and so I had a few million to use to pay for house expansions as well as early purchases of whatever furniture popped up at Nook’s Cranny. My goal in rebooting was to have as few villagers as possible. Initially, I attempted to only have at most two villagers on my island. This didn’t work. It kept my town center tiny and prevented me from being able to do any island customization or other advancement. Only one bridge on my island wasn’t terrible, but not being able to customize the island, that was a big issue. You must get Isabelle on your island in order to have the island evaluation option, and a three-star island is needed in order to get the construction options. Oh, and seven total residents (not necessarily simultaneous).
Recall how I said I tried keeping only two villagers? The internet says it’s a total of seven villagers that need to have lived on your island, not that they must all be present simultaneously. I had planned on cycling them through two homes. It would probably have taken months. I was willing to wait.
I was able to get the Museum and Nook’s Cranny put in, but after a month, neither of my original villagers wanted to leave, my town center was still in a tent, and it became clear that I was out of potential upgrade paths. I wasn’t even getting new notes on the board. The game was just waiting for me to do what Tom Nook requested and put in three more homes.
After visiting Tom Nook and putting in those three new homes he wanted, I immediately had villagers queued up for moving in, the town center was closed for a day for the renovation (moving from the tent to a building), and Isabelle arrived on my island. I still need to cycle through villagers. It might still take months. But things are moving again.
Meanwhile I’ve gathered up all the different produce I can plant, I’ve collected many of the flowers I plan to grow, and I’ve got all the different trees. I’m even doing the seasonal decorating thing with Halloween recipes that are dropping from balloons and villagers.
Update: Ugh, that jerk Tom Nook made me build another house to accommodate the first camper that visited. That puts me at six villagers, or will, by tomorrow. At least I only need to lose and then gain one villager, I suppose.
In addition to playing with different devices, I started making a general purpose bot that would communicate with a radio and make it easier to do round-trip tests for nodes that are on the other side of MQTT bridges or otherwise infeasible to test without help from other people.
So far the bot is pretty simple. I wrote it to listen for arbitrary commands and honor a sort of access control list (ACL) based on sender id. The first command implemented is ping. I also added a help command that returns a list of commands or returns the doc string for the function satisfying a given command. The help only mentions commands for which the requesting user is in the ACL. Otherwise it works pretty much as expected.
Adding new commands is accomplished by matching the function signature of the other commands and adding an entry to the commands list of dictionaries. The dictionary is pretty straightforward, it’s just the command name (what a user would enter,) the function to invoke to satisfy the command, and an optional acl element. Here’s an example:
self.commands = { "ping": { "cmd": _ping_cmd, }, "help": { "cmd": _help_cmd, }, }
So that’s what it starts out as. Then to extend it with a command that echoes the date and time, you could subclass it or just modify the commands member. For example:
import datetime from bot import Bot def date_cmd(bot, cmd, packet): ''' Returns the current time (per the computer's clock, not the radio). ''' return "At the tone it will be ${datetime.datetime.now().strftime('%H:%M')} *beep*" bot = Bot() bot.commands['date'] = {"cmd": date_cmd, }
Then you could send a message to it over the mesh with help and you would see:
The following public commands are available: date, ping, help
And if you sent it help date you would see:
date Returns the current time (per the computer's clock, not the radio).
And if you send it date you would see something like:
At the tone it will be 13:56 *beep*
If for some reason, only a few users were allowed to use that command, you could create an ACL with just those users in it. The previous snippet would need a slight change:
import datetime from bot import Bot def date_cmd(bot, cmd, packet): ''' Returns the current time (per the computer's clock, not the radio). ''' return "At the tone it will be ${datetime.datetime.now().strftime('%H:%M')} *beep*" bot = Bot() bot.commands['date'] = {"cmd": date_cmd, "acl": [0xdeadbeef, 0x1337d00d,] }
Then only the users !deadbeef and !1337d00d would be able to use that command or even see the command when they send a message of help to the connected radio.
Anyway, it’s been useful. I run it at home, head into town, confirm that the bot is up with a ping message to my bot over MQTT, then I shut down the internet link and see if the local nodes will route it. Before I had to drive home and see if the logs showed my messages. This way I can test from a few different locations to see where the weak links are.
I’d like to share this code over Gemini, but I’m not yet sure how to do that. It’s in a git repository that I typically access via SSH for development, but I dont know of an existing solution to just make that available over Gemini. Maybe I’ll just tar up the archive and drop a link here in the future.
Update: Turns out gitolite is really easy to set up. If anyone wants to see my bot code, you can clone it, for example:
git clone git@thatit.be:bot
And then to run it, call the bot.py script and pass it the device to use. A Bluetooth mac address, a USB or serial device, or an http endpoint should all work. I commonly do this:
python bot/bot.py /dev/ttyACM0
Of course, all of that assumes you have the prerequisite hardware and have installed the Meshtastic Python libraries. If you’re using NixOS you can nix-shell shell.nix the file inside and then invoke Python on the bot. I have some other .nix files in there, but I’m still new to this, so the only other thing that’s really working is that you can do this:
nix-build -A bot ./result/bin/bot.py
I also have what I was hoping to use to make a container, but it generates a truly massive container and it’s not worth mentioning beyond this sentence (yet). Similar for the tests.py. I had planned to use drone-cli to run that container, but then I was at a loss for how to get the results out.
created: 2024-10-10
updated: 2024-10-18 13:25:28
(re)generated: 2024-12-17