Hardware pendant Start/Stop button / joystick options?

The docker based version lags behind the pyinstaller releases and doesn’t have the displays decoupled (i.e., action on one client doesn’t cause same action on other client).

But to add the pop-up, it probably would be simplest to do it all in HTML/JavaScript. The pop-up would be a modal containg the numpad that gets 'show’n when user taps the dist to move input. Each button in the modal would add to the entry and when an enter button is pressed, the value is used to populate the dist to move and the modal is closed.

I probably would use the frontpage3d_mobilescontrols.html page in template. I’m not sure when I can get to it as I’m out of town for a few more days and left the power charger for the laptop back at home.

Here’s your cheapest pendant:

Plug and play. Assign macros to keys. Or something.

So I finally spent some real time trying to set up webcontrol. I mounted the pi in the middle of my maslow just above the cutting area but about 4 inches back behind, almost straight down from the cross beam:


Somewhere in the process of mounting the Pi to the acrylic cover, I may have managed to damage the touch screen so it no longer registers touch, but it was cool while it worked. My phone touch screen is 10x better than the pi screen and a kindle device would be about right anyway, but it looks cool with the green backlight and a wireless mouse and keyboard help out.

And I mapped buttons to the rpi GPIO for webcontrol because what I wanted was already done:

13 - go home
19 - set home
26 - shutdown
16 - play / start / run
22 - pause
21 - stop

Question on GPIO: Are the pins set as pullup so all that needs to happen is tie them to ground or do I need to supply a 10k pullup or pulldown resistor and supply power and ground?

Making a handheld wired dongle with those 6 buttons on it would be super easy. I’ve ordered the buttons.

Have we considered using GPIO as a status output (Running/Pause/OFF)? On, flashing, off or red, yellow green like an industrial light tower?

Edit: because my pi is limited to only the 14 pins not covered by the touch screen, a toggle type of selector button would be nice:
A button selector. press once for .1, press again for 1, and again for 10, then again to start over at .1
A button selector for up/down/left/right similar the the distance
A button to tell it to move.
This would make 3 buttons work in place of 8 because with the 6 listed, there are only 3 left that my system would use… though with the state of the screen, that number may go up.

I used gpiozero

https://gpiozero.readthedocs.io/en/stable/

I currently don’t have code wired up for LEDs, but I don’t think it would be hard to do.

from gpiozero import LED

Yes, just never put code in for any led functions, but shouldn’t be difficult… out of town for a few days still.

Buttons are in the control panel.

How would one get GPIO code put in for z axis homing with buttons from a pendant?

1 Like

Make a list of all the functions you want. It’s not hard to add.

As long as I have the screen on there I only have 9 IO’s I can use, so I’m likely going to take it off. I’m interested in the following functions:

Input buttons

Inputs:
UP
DOWN
LEFT
RIGHT
Move X10 (0.1 -> 1 -> 10 - > 100 -> back to 0.1) - (default 10)

Z UP
Z PLUNGE
Z move 0.1 -> 0.5 -> 1 -> 5 -> back to 0.1 (default 1)
Z Axis Zero

move home
set home
shutdown
move to absolute center (original home)

Macro 1
Macro 2

Output Indicators

Status LED (single LED with different lighting to indicate system state)

  • Run/play/start (slow heartbeat)
  • Pause /(blink fast )
  • Stop (On steady - indicating powered, but not running)
  • Error: (OFF)
  • manual move (slow heartbeat - same as run)
    • The actually blink or on states can be changed if there is an industry standard. This seemed intuitive to me at the writing, but may not be the best option.

Move distance LED (single LED with different blinking)

  • blink once then pause for 2 seconds ( 0.1 mm)
  • blink twice then pause for 1 mm
  • blink 3x then pause for 10 mm
  • blink 4 x then pause for 100 mm

Z axis move distance LED

  • same as move LED but for Z axis

That is all I can think up for now.

Another Idea for the rpi zero remote: I have a 0.91" oled display that can show 4 lines of text like this one that was used as a local display for a smart sump pump monitoring system:

That display combined with some buttons and a joystick on a pizero could be an option if it could headlessly load the web page and send data back to it without “clicking” on the buttons I’m very much interested in learning the protocol to “talk” to the webcontrol system. Where do I start?

Webcontrol uses websockets. Best place to look is to look is to examine basesocket.js, frontpage3dcontrols.js and frontpage3d_mobilecontrols.html. basically, the websocket allows you to send messages between the client and the server.

A PiZero would be a poor choice for this. I’d suggest an ESP8266 or other network-capable microcontroller- no booting/shutdown issues.

1 Like

Agree. Just looking at parts on hand. There should be an ESP8266 in the bin. For me I’d like to learn how to make it work though. On the pi I can do it in python. I’m less familiar with the options for the ESP8266. Would it be in nodejs or in C?

programming of the ESP would probably be in C, the 8266 is marginal for a
maslow, the ESP32 is a much more powerful chip.

David Lang

It’s a pendant. It has half a dozen buttons. Its job is to read a button and send the button state somewhere.

Anyway, if you (Orob) are familiar with Python then have a go at making something that works using sockets, then you can port it to whatever hardware you like. Micropython runs on an ESP8266, or you can program the ESP8266 in the Arduino IDE. Or run lua, or whatever you like.

If I can start and stop the maslow with buttons (I’m a believer in this, but have not yet seen the buttons work), the desire is to preserve my nice laptop and not take it out in the dust, so I need to be able to home the maslow without the laptop, so I was trying to make a hand held pendant.

I chose to try the wii remote first. I did the wii remote because I had one with a broken IR cover just sitting around and once I started on it , I wanted to finish it. Unfortunately, the web interface suffers greatly with lag when the wiimote is not connected because it tries to bluetooth connect over and over. This brings the raspberry pi webcontrol system web page response to unusable levels. If desired, the best thing might be a connect button via GPIO so it can be paired and run without a screen for moving to set the home position.


I actually got the wii controller to work with webcontrol with a ton of help and guidance from @madgrizzle (thanks man). I’ve made a video as proof showing that it does work

, but there is some fine tuning and performance issues that would need to be addressed. After running it without a pendant / using my phone, a pendant is not needed. This exercise in making it work taught me a ton about webcontrol and so was worthwhile for me. For those interested in polishing it, the basic functionality is on github on the wiipendant branch.

1 Like

what version of a pi are you using? a multi-core version should be able to let
your wii interface code do what it wants without impacting the rest of the
webcontrol code.

If you are running the bluetooth code as part of webcontrol, make it a separate
process (and if you can, make it generate mouse movement/control)

David Lang

The pi is a 3B. The wiimote runs in its own thread and based on the button presses, it sends actions directly to the self.data.actions object, so the pendant does not interact with the web page at all. The issue is the cwiid library when you tell the wiimote object (wm) to instantiate (self.wm = cwiid.Wiimote() it turns on the bluetooth and takes several seconds before the program does anything else and that code is in its own thread. We could potentially push a button and use the accelerometer to move it with hand waves… I’ve established basic functionality, but see no future in it for my uses at the moment, so I’m putting it out to the community for further development.

Instead of having that be a thread in python (which is still limited to only
using a single core per process), have it be a completely different process and
have it send commands via http. that way it’s not specific to that hardware.

But I understand if you let it sit for now.

I find a phone (even an old one that doesn’t have a SIM card) makes a pretty
good remote, and I think we can make additional screens for such a device to use
that would make more efficient use of the screen space than the current version
(which is mostly a clone of groundcontrol)

David Lang

Did anyone suggest a numeric keypad? Small. Cheap. Wired.

If you can control Ground Control with a keyboard you can control it with a numeric keypad. No drivers. No latency.