#garfield Logs

Aug 22 2022

#garfield Calendar

12:13 AM aandrew: Heh I sure can’t find that deal on Ali
12:22 AM rue_mohr: oh I'll link ya
12:22 AM aandrew: I found the motor, but not motor + controller
12:22 AM rue_mohr: see if they changed the price...
12:22 AM rue_mohr: https://www.aliexpress.com/item/1005004128870655.html
12:22 AM rue_mohr: specifically the 2kw set 1
12:23 AM rue_mohr: I want to realtime tweek values
12:23 AM aandrew: Yes. I’m using arduino on ESP32 and passing JSON around in mqtt
12:23 AM rue_mohr: this comes up again and again
12:23 AM rue_mohr: I usually just stick pots on adc channels
12:24 AM aandrew: Works fine, good enough libraries and no need for bare metal
12:24 AM rue_mohr: I'd like to have someting that works with a web browser or text ui thing to adjust values
12:24 AM rue_mohr: hmm
12:24 AM rue_mohr: I dont mind writing some kinda terminal side program that will take values and draw sliders etc
12:25 AM rue_mohr: but, I think its silly given the flexability of web browsers
12:25 AM rue_mohr: too bad I cant get a web browser to do freaking raw port comms
12:26 AM aandrew: {"Value": 27.3, "Min": -30.0, "Max": 50.0, "Units": "C"}
12:26 AM aandrew: There are LOTS of mqtt dashboard type apps for phones which let you build up a screen of widgets that get/set data
12:27 AM rue_mohr: I'd be happy to make my own binary protocol if I could just push raw data to a port from the browser
12:27 AM rue_mohr: kinda, I want to make sure the microcontroller end is simple tooo
12:27 AM aandrew: No sense in that, it’s more efficient but json is everywhere
12:27 AM aandrew: Lots of libraries including tiny c ones
12:27 AM rue_mohr: JSON.stringify()
12:28 AM aandrew: You can absolutely do it but it’s not very time or brain efficient, better to spend your frustration on things others haven’t already done
12:28 AM rue_mohr: it didnt quite end up bilateral did it...
12:28 AM aandrew: I’m learning that slowly myself
12:28 AM rue_mohr: hmmm
12:29 AM aandrew: Have more arduinoey kind of stuff as proof of concept
12:29 AM rue_mohr: I wonder if the answer is a local service that does the serial<->http
12:31 AM rue_mohr: localhost:serialbinder//dev/ttyUSB0/
12:31 AM aandrew: https://github.com/MaJerle/lwjson https://github.com/cesanta/mjson
12:31 AM aandrew: Both look kind of nice
12:32 AM rue_mohr: php can talk to a serial port tho...
12:32 AM rue_mohr: maybe I dont need to worry about json...
12:33 AM aandrew: You could just reinvent ASN.1… :-)
12:33 AM rue_mohr: ?
12:33 AM aandrew: JSON is nice because ordering doesn’t matter, and you get future proofing almost for free
12:34 AM rue_mohr: its a mine field
12:34 AM rue_mohr: from the client, you need to poll for new data
12:34 AM rue_mohr: so the server cant just push events to the client I/F
12:36 AM aandrew: That’s where mqtt comes in
12:37 AM aandrew: The UI talks to mqtt, the uc does too, and you don’t have to worry about one not being around
12:38 AM rue_mohr: but a web browser interface has to poll for events
12:38 AM rue_mohr: I'm not sure of my goals
12:38 AM rue_mohr: but it would be nice if there was a nice symmetric comm interface to javascript
12:38 AM rue_mohr: without using that big ugly thing
12:39 AM aandrew: I think that’s websockets, not sure
12:39 AM rue_mohr: yea that gets ugly FAST
12:41 AM aandrew: I haven’t played with it at all
12:41 AM aandrew: For me the mqtt “dashboard” type apps are enough
12:43 AM rue_mohr: hmmm
12:44 AM rue_mohr: yea the scope of this needs to be specific
12:45 AM rue_mohr: data can change on the micro faster than a serial port can keep up
12:45 AM rue_mohr: so
12:46 AM rue_mohr: oh haha
12:46 AM rue_mohr: when I did the irc controlled bot, it was irc controlled, it used the acidblood code
12:46 AM rue_mohr: ok..
12:47 AM rue_mohr: but how did I do my last web controlled robot
12:47 AM rue_mohr: non esp8266
12:51 AM rue_mohr: maybe I never tied it all togethor?
12:51 AM rue_mohr: I thought I had
12:52 AM rue_mohr: aandrew, have you ever scrutinized the mqtt latency?
12:55 AM aandrew: It’s been “fast enough”
01:00 AM rue_mohr: its plausable to take the webserver code for esp8266 and build a local serial port bridge on the pc
01:00 AM rue_mohr: but
01:01 AM rue_mohr: sme should be doable in php from apache
01:03 AM rue_mohr: ah but
01:03 AM rue_mohr: php only exists intermittently
01:04 AM rue_mohr: so it would have to be a service of some kind that was persistant
01:05 AM rue_mohr: the esp8266 is C, thus its persistant
01:07 AM rue_mohr: /serialBridge?port=/dev/ttyUSB0&baud=9600
01:07 AM rue_mohr: http://localhost:42/?port=/dev/ttyUSB0&baud=9600
01:08 AM rue_mohr: and the problem is I cant event push data to the user, poll only
01:09 AM rue_mohr: or is the trick to have it query a url that never acually finishes unless the server has new data
01:20 AM rue_mohr: damn how the hell did it get to be 11:00
01:20 AM rue_mohr: it was just 9:00
01:20 AM rue_mohr: I kinda ran out of energy today
01:29 AM rue_mohr: but I want the persistence to be on the client browser
01:29 AM rue_mohr: hmm
01:29 AM rue_mohr: hmm, what kinda UI elements am I actually after here
01:29 AM rue_mohr: right now I want to be able to adjust two values
01:29 AM rue_mohr: hmm
01:29 AM rue_mohr: like alsamixer
01:59 AM rue_mohr: well, the alsamixer source doesn't look horrific
02:00 AM rue_mohr: what I find funny, is that every project I'v seen that needs a UI and uses a UI library, has to make their own library ontop of it to do what they want
02:00 AM rue_mohr: even if its just basic things
08:22 AM aandrew: welll, it shipped...
09:17 AM rue_mohr: I wonder if their going to bump the price way up
09:17 AM rue_mohr: maybe their just money laundering
11:16 AM aandrew: dunno but if I can get a half dozen 2kW motors and controllers while they launder I'm okay with that
11:16 AM aandrew: I haven't got money for a half dozen, but I can dream
11:23 AM aandrew: hah I just realized I can drop this motor on my mill
11:24 AM aandrew: the original motor is a 575V 3HP motor, a 2kW DC motor would be more than enough
11:25 AM aandrew: I'll have to get a plate manufactured and probably see if someone can extend the shaft, but it'd work
07:02 PM rue_mohr: :)
07:02 PM rue_mohr: yea I was ponder that too
07:02 PM Tom_L: crap
07:02 PM rue_mohr: but the 40A 48V supply is a bit of a kicker
07:02 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/cnc/live-build/raspberrry_pi_amd64.jpg
07:02 PM Tom_L: it finally did build
07:02 PM rue_mohr: heh
07:02 PM rue_mohr: you weren't watching it build all day were you?
07:02 PM Tom_L: wonder how you can specify fat on a build
07:03 PM Tom_L: no but for a while
07:04 PM Tom_L: https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.html
07:04 PM rue_mohr: mmm
07:05 PM Tom_L: i'm burning the sd again with the rpi utility instead of dd
07:05 PM Tom_L: probably won't make any difference
07:05 PM Tom_L: https://forums.raspberrypi.com/viewtopic.php?t=34008
07:06 PM Tom_L: it _is_ compiled for arm
07:06 PM Tom_L: arm64
07:07 PM Tom_L: i'm guessing the rpi croud will be less than helpful
07:14 PM rue_mohr: hmm, like to make use of mips processors