-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDM120c with esp8266 #13
Comments
difference for me are stability, no read error (if hardware serial is selected). note: if serial is set on pins 13/15 then sometimes esp do not wake up, because pin 15 must be low on esp bootup process. so, for test try to set other pins first time 120c default baud rate is 2400? You must change this in setup
|
esp8266 do not have hardware uart pin on 12 :)
3 try again |
The software serial library just instal. How pin can be assigned? Pin D0 and D5 ? but the response are �[1;0HVoltage: nanVCurrent: nanA |
you can stay on 12 13, if not working swap wires |
the led tx and rx blink both for four and repeat |
that's good, this mean esp send to sdm and sdm reply... |
the sdm is setup like : 2400 parity none id 1 |
I don't know what's wrong :( try add this line after last reading (frequency)
|
error n° 4 this on sdm.h #define SDM_ERR_TIMEOUT 4 //timeout #define READING_STEP_CNT 4 |
so, esp do not receive an answer but You say both converter leds blinks in the same time, for me You have wrong connected rx wire between converter and esp (not to declared pin) |
If inver the wire rx between convert and esp blink only RxD. `#include <SDM.h> //import SDM template library #define ASCII_ESC 27 char bufout[10]; #define YOUR_TX_PIN D7 //SDM<2400, YOUR_TX_PIN, YOUR_RX_PIN> sdm; void setup() { void loop() { sprintf(bufout,"%c[1;0H",ASCII_ESC); Serial.print("Voltage: "); delay(100); Serial.print("Current: "); delay(100); Serial.print("Power: "); delay(100); Serial.print("Frequency: "); delay(3000); //wait a while before next loop |
I don't know, sorry. |
I'll do some other tests tomorrow. it's very strange because even with sdm staccato flash both rx and tx |
I didn'thave a rs232<>usb converter for test the tx and rx split. The conver |
I've never tested this kind of converters (with de/re pins)
and connect de re pins together to this esp pin |
one more thing... this is max waiting time for read completly reply from sdm |
Hi, i am testing with an SDM530 Modbus. I confirm that the Wemos D1 does not wake up when SoftwareSerial is connected to D7-D8 pins. To have it working i remove D8 cable, i press reset button on Wemos PCB, i put back the D8 cable and then i can see the data on the serial monitor. Changing the MAX_MILLIS_TO_WAIT does not make any difference, i am also on 2400 bauds, this is the default setting on SDM530 from factory. I am testing with a MAX485 module, thank you for your library. |
Hi hgalfas thanks in advantace |
Incredible, workkkkkkkkkkkk. |
MAX485 module https://www.aerial.net/shop/imageslarge/IOT-RS485_main.jpg I used the sdm_simple example from the library with this config //lib init when Software Serial is used: As i said, my meter comes with 2400 bauds from factory so i left it like this. AND BE WARNED: the ESP8266 on WEMOS D1, DOES NOT WAKE UP when SoftwareSerial is connected to D7-D8 pins. To have it working i remove D8 cable, i press reset button on Wemos PCB, i put back the D8 cable and then i can see the data on the serial monitor. |
thanks ngalfas :-) I have a question.
thenks |
Yes, default value(s) will be overwriten with your value from sketch. How do you solve your problem? |
I don't know :-( how pin support the serial similar D7 eD8 ? the w1mos Crash, |
wdt reset |
i am also having crashes with the example. works only for 2-3 minutes, then crashes �[1;0HVoltage: 222.95V ctx: sys
ets Jan 8 2013,rst cause:2, boot mode:(1,6) ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt reset Haven't looked in to it yet. I think it has to do with watchtimer. |
check exception+stack with Arduino "ExceptionDecoder":
|
hi, |
Ok, the crashes on my side were from the PC-USB power source being unstable for both Wemos and MAX485. When i powered it from a wall converter it never crashed again. I added a led lightup on every loop so i visually check it keeps running :) |
hi, I would like to use serial hardware because it works better than softserial |
yes, you can use hardware serial but you can't use "Serial.print" at the same time because hardware serial in this case is used to communicate with sdm if You connect your sdm to standard esp hardware uart (pins 1/3) then
and initialize lib only with Your baud (if You are using converter from first post): |
i am struggling for the whole day to make it work on TX/RX pins on Wemos D1 but i have no luck. And if i switch to SoftSerial and change TX/RX pins, change the apprpriate lines in sketch, it works! but only for SoftSerial. Here is the two types of calling for Hard or Soft Serial #define USE_HARDWARESERIAL // place it BEFORE calling <SDM.h> //lib init when Software Serial is used: on HardwareSerial i even tried calling like |
I have the similar problem. `#define USE_HARDWARESERIAL char bufout[10]; WiFiClientSecure client; #include <UniversalTelegramBot.h> void setup() { WiFiManager wifiManager; } void loop() { sprintf(bufout,"%c[1;0H",ASCII_ESC); // Serial.print("Voltage: "); String msg = String (tmpval); but the results is: "LA TENSIONE" I don't understand. :-( |
@crywolf87 tell me, what it is?
it should be:
|
Now I have find the error. |
gentlemen, you have an additional uart (only tx) for debug (separate rs232 to usb is necessary) |
hi,
and 0x02 to the second meters ? like this post : thank's Davide |
Yes, exactly |
How use the Serial1 ? I have a PL2303_Prolific (rs232 <->usb ). thanks |
GPIO2 is tx pin for Serial1 and print your informations via |
but to see the "some my debug data" I use an external serial monitor or the arduino serial monitor? |
if you can switch to PL2303_Prolific COM in arduino then use it, |
If I use the secure crt (emulator serial) how set the parametri? I read the value when switch the serial to Arduino monitor serial. |
default is 8N1 |
It's works. The converter Rs232 is broken. Thanks |
sorry I have added the 'readVal(SDM220T_POWER, 0x02) ' to read the power but didn't work. ttmp = sdm.readVal(SDM120C_VOLTAGE); //firts meters |
Sorry I never test this option (with two meters at once), maybe someone else use this. |
The reader works with 2 meters at one.
did you try the librarywith the node-red's program? I try this metod to node-red, but i don't know use this library because I don't import the library to node-. |
i there i have 1 nodemcu 8266 and a rs485 i can´t read any values nan every time any help? |
Hi
I can't link ESP8266 with Sdm120C , using interface Rs485.(
Please find the SCHEMA attached.
Could you please tell me how to modifie the sketch to use this configuration? (Vedi schema).
An other favour. What's the difference between hardware serial and software serial?
Many thanks for your support
The text was updated successfully, but these errors were encountered: