Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Helio Machado
@0x2b3bfa0
{"a": false, "b": true}
Why the above code returns both values as false?
A: 0
B: 0
I've checked the file on the spiffs, and it looks good.
Going offline for half an hour. See you later!
Helio Machado
@0x2b3bfa0
Silly error!
I missed to add configFile.readBytes(buf.get(), size);
Holger Lembke
@holgerlembke
Moin!
For a while now I try to build uploading to my esp-12 with CH340T. Works great with manual reset/prog-jumper.
or better: IDE/esptool thinks it is uploading, ESP-12 seems to see something, too. But reset does not work and serial monitor is dead.
Looking on the data lines (reset and gpio0) it looks like everything goes totally wrong.
and I have no real idea where to start to fix it.
Any suggestions?
Holger Lembke
@holgerlembke
(Addendum: building the Nodemcu solution and it works instantly...)
bobcroft
@bobcroft
holgerlembke, I believe the issue you see is to do with the DTR / RTS lines the nodeMCU set up uses these lines to control GPIO 0 and GPIO 2 during the re-flashing of the ESP. The standard download or manual reset does not use these lines (DTR/RTS). I had exactly the same issue as you using a CH340 and found that I could download prpoerly by using the nodeMCU option. However, once downloaded my code did not run as expected so I need to check and see if GPIO 0 and GPIO 2 are returned to the correct state for normal running after the flash download. If GPIO 0 is held low for some reason then the ESP will remain in the 'flash down load mode.
Holger Lembke
@holgerlembke
@bobcroft, yes, thats it. after flashing and with open monitor both lines (reset & dtr) are low. so after reset we end in uart flash mode again.
boils down to the fact that above schematic is kaputt.
oh, and I see spikes on my DTR line around every second or so.
sticilface
@sticilface
Question for boffins... I'm trying to write a method of communication between arduinos and ESP8266 using pjon. I was using arduinojson as the packet structure, but this is very inefficient... I want to create a struct, send it byte by byte, then memcpy it into the struct declared at the other end. This works great... for arduino to arduino... but the problem is that types are different sizes on ESP8266... (not quite figured out which ones yet) but it makes this not so straight forward. Does anyone have any bright ideas.. easy solutions... or examples that are out there... before i struggle and spend lots of time trying to work one out! any help appreciated...
Me No Dev
@me-no-dev
uint8_t is uint8_t everywhere. Same goes for uint16_t and uint32_t
Keith Andrew Hill
@vic10us
Whatever you do, just make sure that your structs are using primitive types that are supported directly by the processor architecture of both systems.
Me No Dev
@me-no-dev
int is not the same
sticilface
@sticilface
ok... that might be where the issue is..
Me No Dev
@me-no-dev
word, size_t, things like that are platform dependent
sticilface
@sticilface
i guess enum is too
Keith Andrew Hill
@vic10us
uint_8 or uint_16 bit etc
sticilface
@sticilface
float?
Keith Andrew Hill
@vic10us
Floats are dangerous.
And mostly unnecessary as you can represent them (with some mi
Minor loss of resolution) via conversion to an int by multiplying them by some large value.
123.123 could be multiplied by 1000 to result in 123123
Google does this for example to solve for currency storage by multiplying the original value by 1000000
sticilface
@sticilface
ah that makes sense.
thanks
Keith Andrew Hill
@vic10us
The other standards to look into are BSON and MessagePack.
sticilface
@sticilface
what about signed versions like int8_t... etc
Keith Andrew Hill
@vic10us
Those are essentially stored the same way. The only difference is the lsb or msb in memory.
I almost never use signed int value as negative numbers are usually undesirable
Especially when dealing with security
At least in transit
sticilface
@sticilface
cool thanks... i think what i'll do is use the standard numbers... should work
see how i get one....
message pack looks interesting though
geman220
@geman220
Does anyone here have experience with the Wiced Feather?
Michael Miller
@Makuna
@sticilface the other issue to be concerned with is if you have a structure that has uint16_t followed by a unint32_t; is the size of the struct 6 or 8 bytes? Both lengths are valid, to make it more standard you will have to wrap your struct with a #pragma pack (push,1) and then a #pragma pack(pop) to make sure the structure is packed by bytes. For enums, you should be able to define them typed like
enum MyEnum : uint8_t
{
    value1,
   value2
}
Stavros Korokithakis
@skorokithakis
does this library look at all useful to anyone? https://gitlab.com/skorokithakis/esp-boilerplate
geman220
@geman220
@skorokithakis I have a quick question for you if you don't mind.
Stavros Korokithakis
@skorokithakis
sure