tuanpmt / esp_bridge Goto Github PK
View Code? Open in Web Editor NEWESP8266 firmware SLIP Command, support mqtt, restful client
Home Page: http://tuanpm.net/post/esp_bridge
License: MIT License
ESP8266 firmware SLIP Command, support mqtt, restful client
Home Page: http://tuanpm.net/post/esp_bridge
License: MIT License
The default content type should be application/x-www-form-urlencoded
, not just x-www-form-urlencoded
. As is, it will fail on some sites like Pushover.net (I modified the Pushbullet example), but works with application/
added.
The default user agent is spelled ESPDRUINO
instead of ESPDUINO
, and I think the extra R
means that the array is 1 character shorter than it should be (but is correct if it were spelled without the R
).
The Host
header should specify a non-80 port. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23
Apologies in advance for improper terminology, I know next to nothing about TCP / IP / ICMP.
I think I have figured out that an issue I thought was with Espduino is actually a problem with how this library handles TCP fragments.
Based on tcpdump, it looks like some local servers I've been using for testing purposes split their response and end up with the HTTP/1.1 200 OK
in one TCP fragment and the remainder of the fragment separately. Using the exact same app (e.g. with Python Flask, but also tested with others), if the TCP fragment is split up this way, any other browser or curl is able to reassemble the packets and gets a whole response, but my Espduino only gets the contents of the first packet, after which it waits 5 seconds and times out, reporting a 0
response code.
I added a line to the tcpclient_recv
function in rest.c
to help debug:
INFO("DEBUG:\n%s\n\n", pdata);
And the output as I anticipated is EXTRA DEBUG: HTTP/1.1 200 OK
(but nothing else) when the TCP packet is split (they consistently end up getting split right after this part, with the remainder of headers and the body in the next packet).
When the TCP packet is not split (because I'm serving through nginx or mitmproxy, which join the split packets), the response for the exact same code is:
EXTRA DEBUG: HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 38
this: that
Server: Werkzeug/0.10.4 Python/3.4.3
Date: Mon, 14 Sep 2015 07:17:15 GMT
<html><body>hello world!</body></html>
I'm going to work on trying to figure out why it isn't handling split packets like other apps do.
Hi, I try to use your espduino for SSL connection. I burn the firmware that is already provided in espduino, and write my arduino program, everything works.
Later I try to modify the firmware a little bit, so I compile the firmware using things contained in esp_bridge. The compile is successful. However, after I burn the firmware and run the program again, this time the SSL connection fails. It shows Client handshake start. then Client handshake fail
So which SDK did you use to compile the esp_bridge? I am using v1.0.0
Hello, I am trying to use this esp_bridge code with smartconfig. I can use smartconfig and SLIP seems to be function properly. Unfortunately, it cant send mqtt data to 2lemetry. Using firmware you put in espduino repository, I can send mqtt to 2lemetry.
Do you use different source code to generate that bin? e.g. using compiled code from this repo, esp will enter softap mode, while firmware in espduino put the module into station mode.
It'd be really great to have a Python script or something running on the Mac/PC side that emulates this bridge and dumps verbose debugging information - I've found it sort of hard to debug my Arduino sketches without stubbing out all of my network calls since everything wants the UART.
As a side benefit, this would make it easier to attach Charles or Wireshark to inspect communication on the wire.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.