Protoman Example using HTTP API

Hey folks. I have a T-beam set up as a Wifi client on my network. I am able to hit the the following endpoints using Postman:

  • POST /restart - restarts the device
  • POST /json/blink - blinks the LED
  • GET /json/scanNetworks - returns a JSON document with a list of networks
  • GET /json/report - returns a JSON report of activity
  • OPTIONS /api/v1/toradio - returns 204 with Content-Type and X-Protobuf-Schema headers

However GET /api/v1/fromradio just returns a 200 OK with no body. I set the Content-Type to application/x-protobuf. I kind of expected some kind of binary response - but got nothing. I even sent some messages over the mesh, which showed up on the OLED display of the device I am targeting - but still nothing returns from fromRadio.

I set up Protoman, git cloned the protobuf files and set them up in Protoman (clicking “Build and Save” resulted in “Build Success”). I tried hitting fromRadio with an expected message type of .FromRadio, but when I click “Send” it just sits and spins the “Sending request…” progress indicator.

If someone can point me in the right direction, I’d really appreciate it.

1 Like

Ok, so I went ahead and ran the Meshtastic Web on my laptop, pointed to the T-beam on Wifi and it is working great. Using the Chrome dev tools I noticed that it is appending all=false to the endpoint.

So I shut down the Meshtastic Web client and went back to Postman and am able to see stuff come back from the fromRadio endpoint. So not sure if its just luck, the addition of “all=false”, or if the web client configured something on the device that is making the HTTP API work now…

Pretty sure this issue with HTTPS is what was causing my issues. Protoman forces HTTPS and I was using HTTPS in Postman as well, until I saw the Web UI was using HTTP XHR requests…

Yeah, the library supports both http and TLS connections, requests over TLS are quite a bit slower, so that’s what I use in development.

Would you be so kind as to add full steps to reproduce the problem you described to https, the device received a request, and either fails the handshake or just hangs up, then seems to cause a WiFi disconnect · Issue #903 · meshtastic/Meshtastic-device · GitHub ? That’d help with tracking down the problem if they are related.