JamSentry Plugin

I have developed a plugin for JamSentry. JamSentry is a DIY device to detect printer jams and filament runouts. It works for almost all printers and does not need hardware or firmware mods to the printer. Info on JamSentry is here: https://robogardens.com/?p=2220. The plugin is here: https://github.com/percy9427/OctoPrint-JamSentry.
It all works, the problem I have is that according to the guidelines I cannot add it to the public repository.

The JamSentry consists of a small microprocessor (ESP8266), a filament sensor, and a magnetometer. The magnetometer attaches to the side of the extruder motor and detects when the motor is driving. If the motor is driving and the filament isn't moving you have a jam or have run out of filament. It sends an alert to the Gcode sender. The JamSentry plug-in implements that receiver and can pause the print.

The JamSentry device is configured via a web interface and provides its status via a web interface. The plug-in includes the status page as an iframe within a tab. The problem is that the ESP8266 processor is too constrained to support an https interface (it struggles with a http interface). So by the guidelines I cannot include it.

The status info is for convenience. I can cripple the plug-in by removing the iframe. It will still work and receive still receive the alerts, but you will need to remember the JamSentry address and open it up as a separate webpage if you want to see the status.

Suggestions appreciated. Stephen

1 Like

Sounds like the problem here is your architecture. You could easily use TLS to talk to MQTT from the ESP8266 and have the plugin subscribe to an appropriate MQTT topic. Then you don't even need to serve web pages. The alternative would be to use websockets and TLS, but FreeRTOS+TCP/mbedTLS/MQTT is probably the right stack for this, possibly FreeRTOS/lwIP/mbedTLS/MQTT if you prefer.

That said, this isn't really an OctoPrint issue so much as a product architecture/embedded programming issue.

I could certainly use MQTT or COAP or some other protocol designed for constrained devices. But I wanted the status pages and configuration options to be human accessible. I didn't want to require that they have a MQTT client or some other program installed to be able to use JamSentry.

There has to be a way of editing the haproxy configuration so that https://localhost/whatever/ goes to http://192.168.1.xxx/.

That does defeat the point of https, though. That said, in response to use MQTT and having something over http for direct human config, you should be able to get both in...it mainly depends on the size of your flash and whether you do OTA updates. At this point, though, you probably are using an ESP8266 where you really need an ESP32. An ESP32 would handle https and MQTT over TLS just fine.