TowBots, ESP32 boards, Bugs and Other Silly Stuff

Update: 2/13/2021

Meshy stuff.

I uploaded meshtastic onto two of my TTGO T-Beam One with everything would you like fries with that boards. OK, they aren’t really called that but they should be. Meshtastic is an open-source communications app that uses LoRa to talk at a substantial distance between two boards, compare GPS locations using the on-board GPS module and antenna, then calculate the distance and heading between the boards. Does this sound familiar. So the well-constructed system basically provides about 75 percent of the functionality I need, and the boards are about 30 bucks (or less if you shop around) each. Major cool. I can also connect to the boards with an iPhone or other device and send short messages. text messages. The system automatically meshes all the LoRa radios it finds running the software, so it can act as communications between people in a widely dispersed group. Messages and location of the two furthest away people hops all the way to all parties involved. Very cool, very cheap, very useful for groups doing outdoor activities, especially where cellphone connectivity might be sketchy or unhandy. I’m going to use this in the TowBot, which might make it into kind of a safety enhancement device. I could send it to rescue a friend if their gear breaks, or just tow to them to lend a hand.

It will also be the guts of the control system.

Here are two “fries with that” boards talking to each other. If I were doing this outside they would be showing the GPS location of each other and an arrow in the circle would point at the other board. No GPS satellites inside, but you get the picture. Unknown 2ae8 and 2450 are the addresses of the other board they are receiving transmissions from (ewww, fractured grammar).  These buggers are working nicely.

end update

I took a sabbatical from building electronics stuff for the last four months, mostly because we rented houses in SoCal to get out of the cold without getting on a plane. First in La Quinta for a month so Diane and our friend Twila could golf, then in Solana Beach for a month, and now in La Jolla Shores for at least two months.  I brought some stuff with me, but it’s kind of minimal compared to my usual equipment. I also got kind of sidetracked trying to switch from the Arduino IDE and editor to VS Code (Microsoft Visual Studio Code) with the PlatformIO IDE extension. I like the power of the VS platform, but the complexities are a little overwhelming for an amateur faker like me. I didn’t bring any MS-based computers with me, just my MacBook Air (no, I don’t multi-boot it) and a few raspberry PIs with touchscreens running Raspbian that I use as servers for MQQT and other utility stuff.

Recently I started fiddling with an eFoil I bought. It turns out that eFoiling oneself around is a little boring, so I decided to convert it (reversibly) into a tow sled to pull me into waves on my regular foil board. I assumed I could just paddle out to retrieve it, but that turns out to be a lot harder than I expected. Especially here in SoCal where the waves I want to ride are quite a way offshore. I almost lost the dammed thing.

All I did to the eFoil other than a few deck mods to add a tow line is take the foil off. The remote control for the eFoil throttle works up to about 100 feet away, so that didn’t require any changes. I added a PVC pipe extension that the tow line feeds through off the back which gives a lot of steering control simply by offsetting which side you ride on–riding left turns the board right, etc. I could even turn it just by swapping my hand. The PVC pipe also keeps the line out of the prop, and was supposed to prevent the tow from riding nose-up.
Once you let go of the tow line and get a good distance away from the eTow it’s invisible in any chop or swell. I had a hell of a time finding it when I got a long ride, so I put a flag on mine by splicing in three T connectors. The front and back connectors have short stubs to hold the flag T connector vertical. I used a threaded T for the flagpole to make the pole removable. I suspect a flag is probably required anyway.

As it turns out, my early success with the tow was mostly good luck and being a wimp. I didn’t have it tow me very fast, I used my biggest foil combination, and I had a fairly short extension. My longer flag/rope extension screwed up everything. Not only did it NOT turn better, it also picked the nose up easier–completely the opposite of what I expected. In my usual stupidly optimistic way I switched from my Axis 1150/440 combo to a 860/340 that needs a lot more speed. It seems that I was getting away with a lot of mediocre choices by simply going slower which the 1150 permits.

Once the nose comes up enough it starts torque steering and wants to go left. The longer extension out the back somehow made the steering substantially worse and does nothing to combat the nose lifting. Even with the extension shoved as far forward as it would go the steering was much harder and required slower speeds to work.

So I decided I need to build a dedicated sled, a project that will have to wait for me to get back to my shop in Hood River. But I could start on the electronics right away. Hence this project I’m calling the TowBot. The TowBot needs to come get me when I finish riding a wave, in fact, it should stay with me unless I tell it not to, which will make it very cool for doing downwinders without a wing foil.

Imagine my surprise when I discovered that code I’d written that runs on ESP32 boards would no longer compile–even simple little projects like my lighting control system for Fritz, the motorhome. I don’t generally use my Mac for developing Arduino stuff, but I have used it before and all the projects I’ve developed have lived at various times on both platforms. It turns out that the Big Sur release of the macOS breaks some of the Python stuff in the guts of the Arduino IDE, specifically in how it interacts with the ESP boards. Figuring out a workaround took quite a bit of digging. I finally found a solution on Github that uses what I assume is a beta release of the board extension for ESP32. This is the GitHub topic, I’d post the URL but that’s just Github.com:
MacOS Big Sur dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found (ESPTOOL-82) #540

And if you’re trying to fix a similar problem here’s the address for a beta version board manager JSON script that you paste into Preferences>additional board manager URLs instead of the stable release URL (which results in an installation that doesn’t work): https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

This is all a longwinded way to say that in the process of digging and fiddling I found three ESP32 boards that are my new favorites, all from LilyGo. The first is the LilyGO TTGO T-Display. It’s about as cheap an ESP32 board as I’ve found, and it includes a 240×135 pixel IPS TFT display, 4MB SPIFF, WiFi, Bluetooth, built-in antenna, CP2104 USB-to-UART (that’s a good thing–supports higher transfer rates), and a 3.7V battery charging circuit. The battery management is a bit spooky as it seems to supply 5V to the 3.7V LiPo when the USB adapter is connected. I didn’t test this with a battery connected so I don’t actually know that it would overcharge the battery, but I’m going to be careful with it.

The associated GitHub support topic has a ton of examples, fonts, etc., mostly in the eSPI_TFT folder as well as schematics and other stuff and some clear instruction on how to install the library and use the chip. https://github.com/Xinyuan-LilyGO/TTGO-T-Display

It’s got a limited, but adequate set of the usual GPIO, ADC, DAC, touch pins, etc. Click the image to see it full size:

I find it easy to understand the examples and get the display working, displaying whatever I want. The WiFi connection works surprisingly well considering the dinky antenna. It picks up pretty much everything in the neighborhood.

The board is about six bucks on Banggood. Wow.

The second board I’be been playing with is the T-Call from LilyGo. I don’t have an immediate reason to have this board. The major projects I’m working on–the TowBot and Fritz, my stupid motorhome project, don’t have a compelling reason to connect to phone networks. I can’t mention the moho project without including the adjective stupid. A guy who doesn’t like motorhomes undertakes a restomod of a motorhome, despite having clear prior experience of the agony, effort, and pointless time spent modifying a 33′ airstream into a race car hauler. No other term fits but stupid project. But I digress. This board accepts a sim card and can connect wirelessly to 2G networks.

Very cool, and it does all the usual ESP 32 stuff while allowing yout to transmit any kind of data wirelessly to and from any place in the world as long as there’s a 2G network on the sending end. No idea what I’ll use it for but I’ll think of something. RNT (Random Nerd Tutorials–my favorite place to learn about new tech stuff) has a nice tutorial on the module: https://randomnerdtutorials.com/esp32-sim800l-publish-data-to-cloud/

When I have time I’ll do the tutorials.

I saved the best for last. I call this the Zen module, in the same sense of the Zen Pizza order: “I’ll take one with everything.” The LILYGO® TTGO T-Beam ESP32 433/868/915Mhz v1.0 WiFi Wireless bluetooth Module ESP-32 GPS NEO-6M SMA LORA 32 18650 Battery Holder and charge controller.

This is the solution for the TowBot–and a lot more. By everything I mean it’s got an ESP32 v1, WIFI, Bluetooth, 8MB PSRAM, 4MB Flash, 3D Antenna, LORA, GPS, blah, blah… One thing I didn’t know it had is an AXP192 power controller, which can switch the peripherals on and off. After I finished installing the OLED boards on the two I bought, one of them didn’t work. and while I was trying everything I could think of, including unsoldering the connectors and resoldering it the other one quit working. After a lot of searching I finally found this on GitHub from a guy named Simon Rafferty:

I had the same problem out of the box! The 3.3V pin header read 1.8V and nothing else was powered at all. The reason is that it has an AXP192 power controller to allow the ESP to switch peripherals on & off.
Have a look at the AXP202X Library by Lewis He:
https://platformio.org/lib/show/6657/AXP202X_Library

Add the following to your sketch:
#include <axp20x.h> AXP20X_Class axp;
And in Setup():
`
//Turn everything on
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC3, AXP202_ON);
axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
axp.setDCDC1Voltage(3300); //Set Pin header 3.3V line to 3.3V. Processor is happy down to 1.8V which saves power

Everything will come back to life!

It turns out the ESP will operate down to about 1.8V quite happily.

It has a load of potentially useful (cool) features including setting the voltage supplied to any of the peripherals (to save power) and measuring the current supplied to them. You can detect whether the battery is being charged – and read the charge/discharge current.

People have commented that the battery doesn’t cut-off when over-discharged. I suspect this needs explicitly setting up on this chip too.

I had concerns about the battery charging, with the USB connected I read 5V on the battery terminals. I was looking at it because I read somewhere that these boards have a problem toasting LiPo batteries. I’d read it was a hardware design error–no blocking diode preventing the USB voltage from bypassing the charge controller, but maybe it’s software. I’ll need to dig in and resolve this. In the meantime, this looks like it should be the guts of my TowBot. I was thinking of using a Pixhawk drone controller since a lot of the functionality I’d need is already present, but that would still require a lot of customization and some peripherals for my idea, which is to have one T-Beam be a beacon I’ll carry, and the other be the controller in the TowBot. They’ll broadcast their GPS position to each other as LoRa data, calculate a heading and distance, and then on command, the TowBot can drive itself to the beacon (and me). It’s a pretty simple navigation approach, I don’t plan on any object avoidance or other complication–it should be adequate in open water over short distance.

Here are the T-beam modules, that’s the OLED board in front prior to soldering it in place. Immediately behind the T-beams is the T-call module and further back is the T-display module.

While I’m at it, here are some other shots. In front, the T-beam with OLED in place and a T-Call. The lumpy assembly with the MOSFETs is a four-channel light control I built for the Motorhome project. The lights can be manually switched as a local fallback and switched/dimmed by touch control or by or any connected device using a Node-Red panel via MQQT in the local WiFi network in the Moho. The MQQT server is a Rasberry Pi mounted behind the small touch screen in the background. The lights and other appliances and accessories can be controlled from the touch screen as well as any device connected to the local network. I’m doing local WiFi only for the control systems. I don’t want some clown in Belarus to be messing with my airbag leveling system, which is the 4-relay board (the blue boxes are relays) in the upper right corner wired to the breadboard. There’s a lot going on in this picture.

Here’s the OLED soldered to the board and happily telling me that the GPS can’t find any satellites indoors just before the power controller decided to randomly shut it off. Oddly the OLED was the only thing that got depowered. Murphy is alive and well.

No, that isn’t SpaceX’s latest mars rocket, it’s probably going to be the propulsion system for the TowBot. It’s a high-performance electric motor and gearbox for an eFoil that I bought from a wizard in Australia. I bought two of them, one I’ll probably use to build a high-performance ultralight eFoil, the other will drive the TowBot. Gorgeous things, he has a few more, I should probably buy them all. I couldn’t produce these for anywhere near the asking price, even if I value my labor at zero.

As I progress in working with these boards I’ll use this blog post to record my findings. It’s a necessary process–my memory sucks. I write all kinds of notes in notebooks and then can’t find them. I hope this will work better.

Addition re: Meshtastic

The T-Beam can also run Meshtastic. From the Meshtastic site:

Meshtastic™ is a project that lets you use inexpensive ($30 ish) GPS radios as an extensible, long battery life, secure, mesh GPS communicator. These radios are great for hiking, skiing, paragliding – essentially any hobby where you don’t have reliable internet access. Each member of your private mesh can always see the location and distance of all other members and any text messages sent to your group chat.

The radios automatically create a mesh to forward packets as needed, so everyone in the group can receive messages from even the furthest member. The radios will optionally work with your phone, but no phone is required.

For anyone doing downwinders or other water activity, this is obviously a cool thing. I don’t see any reason why I wouldn’t build the beacon and TowBot to run Meshtastic as well as the nav system for the bot to pick me up. 30 bucks apiece to keep track of all your buddies and be able to signal if you get in trouble or find something interesting–that seems like a big win. I’m tempted to make a bunch of these to give to friends. A nice little “give back” project.

Video for hull construction:

 

First cut at hull specifications.

I think 4 feet is about the right length for this thing, but to give myself some room for error I’m going to make it 1.5 meters (150CM) or about five feet.

At 150 cm and a nine percent width/length proportion, the hull will be 13.5cm (5.3″) at the widest point. An 8% bulkhead at 43% of the length is 12cm wide at 64.5cm. I’ll fair up the curve with a stainless steel or aluminum tube 12mm (.47″) in diameter/ I plan to have the tube open at the top to make it easy to plug in accessories like a camera mount later. I’ll do this in a number of places.

The nine percent bulkhead (12cm), which gets added once the fair curve is established will be at about 30cm from the front–20 percent of the total length, though I’ll slide it to whatever position leaves it snug but not distorting the curve and then tack it there. the rest of the bulkheads will be at 10,30,50,60,70,80 and 90 percent of the length. I’ll measure the width at each of these places to determine the width. All the bulkheads for both sides will be identical widths, the hulls need to be as similar as I can make them.

I’m toying with two different ideas for battery location. It seems placing them in the hull with the weight forward makes the most sense. I can seal the batteries in a completely waterproof chamber and even pot the entire hull in expanded foam with the exception of wherever I place the electronics. The downside of catamarans is always the potential for capsizing. They can’t easily be made to self-right. Having the batteries immobile in the bottom of the hulls will help with that.

I plan to put the motor on a foil mast bolted to the center of the platform that joins the hulls. I might experiment with additional masts to hold a wing and added support for the rear of the motor. The mast needs to be deep enough to keep the motor submerged, but not so deep that it makes keeping the nose down too troublesome.

Something Wicked This Way Comes

I just kind of like looking at these:

2 thoughts on “TowBots, ESP32 boards, Bugs and Other Silly Stuff”

  1. That’s an interesting project! I’m only an amateur, but it seems to me that the hulls of the shape you’ve sketched will have control issues due to the yaw that will be generated when a swell catches them on the quarter. The “Tesla catamaran” that you reference is good at slow speeds in calm water, but would, I think have issues trying to navigate over a swell or being buffeted by wind chop.
    Just my initial thoughts generated by your post.

    I was led to your post by Marianne on Saltspring Island.

    1. Yes, there are limitations to catamarans, but I think this will be effective in the expected environment. I expect to use hydrofoil surfaces to control some of the issues, and I’ll mostly be using this in the Columbia River, which is kind of linear. If it all goes to hell I toss version one and build something else–the expensive parts will transfer easily. This build is really trivial, I’m a thousand miles away from my shop but I built a pretty good hull today in about an hour with hand tools and masonite. Thanks for the comment.

Leave a Comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: