Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Lars Englund
@larsenglund
after that follows alot of errors about the expansion of the macro HIGH..
The wifi scan example compiles just fine
tzapu
@tzapu
@larsenglund no probs, don t know about the other thing..
Lars Englund
@larsenglund
Apparently an update to the Keypad library did a #define CLOSED HIGH in Keypad.h which seemed to be the source of the problem. Redefining it to #define BTN_CLOSED HIGH made the errors go away..
It was colliding with a definition of CLOSED in some WiFi stuff..
Helio Machado
@0x2b3bfa0
Hello!
@all the Benoit Blanchon ArduinoJson users: Only a question:
File configFile = SPIFFS.open("/config.json", "r");
  size_t size = configFile.size();
  std::unique_ptr<char[]> buf(new char[size]);
  StaticJsonBuffer<200> jsonBuffer;
  JsonObject& root = jsonBuffer.parseObject(buf.get());
    bool a = root["a"];
  bool b = root["b"];
  Serial.print("A: ");
  Serial.println(a);
  Serial.print("B: ");
  Serial.println(b);
config.json contents:
{"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.
Helio Machado
@0x2b3bfa0
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