Maslow Home Maslow Community Garden Newsletter

Wiimote Control With Raspberry Pi and Web Control

The wii3 branch in the orob-maslow repository (for now until it is fully tested) has a working version with 3 new items, all of which can be toggled in Maslow Settings:

  1. GPIO button service

A separate button service (systemctl MaslowButton.service) starts as its own process when webcontrol starts.
MaslowButton.py can take input on the raspberry pi GPIO an communicate with webcontrol via web socket put and get requests. Push buttons are configured in the gpio settings page in webcontrol. When changes are made, the service restarts and they get reconfigured. On the controller I’m using do the following buttons:

-play (start gcode cut)
-pause / resume
-stop
-start wii pendant bluetooth service
-shutdown the raspberry pi

  1. Wii remote pendant operation (designed for 2 handed controller use - no accidental movements)

When the wii remote service starts from a button press (MaslowPendant.service) connects (via bluetooth), the wii remote can:

-move the sled home, up, down, left, right (press 1 + dpad direction or just home key) depending on which battery light is lit on the wiimote, it is 0.1, 1, 10, or 100 mm (select distance with the +/- keys)
-set sled home at current location (1 + Home, keep holding 1 and press A to confirm)
-move z: raise or lower (2 + up or down)
-zero z axis at current location (2 + home, keep holding 2 and press A to confirm)
-play / gcode start cut (B + UP)
-pause / resume gcode cut (B + Left, B + right)
-stop movement (B + Down)
-disconnect (A + B). When the wii remote disconnects, it turns itself off and the pendant service process running on the pi ends. To reconnect the wiimote, you must press the pendant button to restart the “process.”

All up/down directions are with the wiimote held horizontally.
Each command rumbles the wii control so you have feedback it is supposed to be doing something

  1. A local command line interface shows relevant information from webcontrol.
    this one is more for me because I have a hard time knowing where my next cut will be. A 5" panel mounted in portrait mode shows zoomed in command line text of the home position coordinates and the distance from the sled center to the right and top of the cut, so a tape measure can be used to see just how far the design goes.
6 Likes

I am interested in the Wiimote control but I am running a Windows operating system. Is it possible to control the Maslow with a Wii controller using Windows? If so how do you get the Wii remote to interface with a software? Thanks

The short answer: I don’t know how to do it in windows. It only works with the raspberry pi. That does not mean it could not ever work with windows, but it currently does not.

Functionally there is a python library called cwiid that interfaces with the wii remote and the bluetooth. There is a maslowpendant service that uses the cwiid library to connect to the controller via bluetooth and then interfaces with webcontrol over the web socket similar to the web page interface with some lines of code added to main.py to interpret the input. I can show you how it works, but I’m not sure how to launch system services in windows without writing new code.

I really appreciate that and I might take you up on it at some point in the future. I bought a Maslow about 3 years ago right after they ran out. I’m finally putting it together over the last few months slowly but surely. I have noticed that when it is moving around sometimes I would like to stop it or jog it slightly and I don’t have a touch screen.I really do appreciate your fast response. Once I get in up and running and accurate I’ll see if there’s a need. Stay safe

An interesting add-on would be a wifi pendant with buttons to do everything without being tied to bluetooth and communicate over the wifi. This would not tie it to any machine base.

I call that my phone :wink:

4 Likes

I use an app called Splashtop. It’s a paid prescription much like log me in. It seems to have a very light footprint and allows me to control any of my computers remotely even from my cell phone. Don’t you Arduino boards have Wi-Fi in them?

1 Like

You could use a program like glovepi with your wii remote as a mouse in windows, but a wireless mouse might be easier.

I use a wireless mouse now. It’s good and responsive but there isn’t really a work surface for it.

Thanks

there are mice designed for presentations that have a gyro in them, so you can
hold down a trigger and move/tilt them in mid-air