Update Teensy 3.2 Sketch Variables Remotely

Status
Not open for further replies.

eddcaton

Member
Hey All,

I have been mucking around with a project for the last few months and now have the basics working.

Now i am looking for a way to update variables that a sketch will look at. But i would like to use a GUI for web page based UI to amend the "settings" (variables) for a user friendly experience.

I have looked around the Internet quite a lot, but haven't really had much success.

If anyone would have some suggestions that would be great.

Regards,

Edd
 
How is your Teensy 3.2 getting internet/remote connectivity? WIZ820? USB to a PC? Something else?

Without a clear picture of how your project works, what it actually does, and how it connects, how can anyone hope to make any relevant suggestions?
 
Have not gotten into the internet update aspect, but, have used SerialEvent to input data strings and parse them to extract variable values, do a calculation and return an answer to a remote serial terminal. Check out the example given. it is fairly easy to modify for other uses and for other serial inputs (Serial1, Serial2, etc.)
 
With the added info - perhaps something like an ESP8266 would do the job?

It can sit on WiFi and present a web interface and then serial can be used to transfer data on and off between the Teensy and the web page.

It can be setup and programmed under Arduino as well. I had a seemingly workable start some 2 years back : ArduinoTeensyESP8266
 
Hey,

Thanks for the reply's

I am making a LED WS2812B strip controller where i am using USB and JINX to control the strip's. I would like to be able to change the LED string length variable via a UI, preferably IP based web page, but could be a LCD screen and buttons.

Edd
 
ArduinoJson works well if you'd like to use JSON formatted strings for configuring your software. You'd still have to figure out a method for sending those strings, but it can help with the serialization and de-serialization aspect. I'm not affiliated with the library, but I'm using it on a few projects over I2C and serial with Teensy devices and it works well. Might be a bit overkill for just changing 1 parameter though.

https://github.com/bblanchon/ArduinoJson
 
Some LED length variables are built in at compile time. Though it seems you might declare for MAX length and then address a shorter length when desired.
 
So am i right in thinking i need to attach an ethernet sheild to the teensy and then look into a Web base UI?
 
Or you attach a touch LCD display. If you don't want to put a lot of CPU ressources in programming a GUI, an external HMI like the Nextion display might ease the task.
 
So am i right in thinking i need to attach an ethernet sheild to the teensy and then look into a Web base UI?

Indeed - no native Ethernet hardware support included with a Teensy - the ESP would do that with WiFi - or add on wired or other
 
Hey Not having much luck with the ethernet shield I currently have so I have bought a Wiz820io as this seems to be supported and documented a lot better than the ENC28J60 module I currently have.

Does anyone have any tutorials on the Web interface that a user can connect to via the device IP, change and save variables?

Any help would be much appreciated.
 
Basically, it is about turning the Teensy into a web server which displays a web form where you can make entries, and which has a submit handler which processes your input to update the variables.

It's not very different from coding any other html form.
 
Hey Not having much luck with the ethernet shield I currently have so I have bought a Wiz820io as this seems to be supported and documented a lot better than the ENC28J60 module I currently have.

Does anyone have any tutorials on the Web interface that a user can connect to via the device IP, change and save variables?

Any help would be much appreciated.
Using the wiz820io (or 850io) and the teensy Ethernet library, i would start with the library example WebServer. You can connect to that sketch with your browser, and it will read values from the ADC and send them back to your browser. From there you can expand the server to parse various GET requests and toggle the LED, or change or read various variables in your sketch.

See https://github.com/manitou48/teensy3/blob/master/wizwww.ino

Other options,
WICED photon ($19) (web IDE) with cloud interface, smart-phone app Tinker to read/write your device ports, https://store.particle.io/collections/photon

or apache/PHP etc. on Raspberry PI
 
Last edited:
Status
Not open for further replies.
Back
Top