Skip to content

Software serial junk in nodemcu #4915

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

Closed
viswanadh401 opened this issue Jul 10, 2018 · 6 comments
Closed

Software serial junk in nodemcu #4915

viswanadh401 opened this issue Jul 10, 2018 · 6 comments

Comments

@viswanadh401
Copy link

viswanadh401 commented Jul 10, 2018

I am sending some characters from my STM32F1xx at a baud rate of 9600. I wrote the code for software serial in my nodemcu for pins 12, 14. [SoftwareSerial swSer(12, 14, false, 256);] And set the baud rate at 9600 and trying to print in serial of nodemcu at 9600. The serial port showing ⸮⸮⸮⸮⸮⸮⸮⸮ continuously. I set the baud rate in serial com is 9600 and Both NL&CR. I upload the code at 115200 speed to nodemcu. How to receive correct data...? Please help.

Thanks in Advance

@RudyFiero
Copy link

RudyFiero commented Jul 10, 2018

I assume it is a programming error. Because nothing you have said indicates a problem with the ESP8266/Arduino repository. This is not a general help forum. It is specifically here to deal with repository code errors or changes to this repository. If you need help in programming then places like www.esp8266.com and stackoverflow.com is where you should ask your questions.

But when you do, provide relevant information. Things that you have tried, What code you are using. What libraries if any.

@kapyaar
Copy link

kapyaar commented Jul 10, 2018

I happened to play around with the software serial these days too, and I came across the same issues. Here are some thoughts without knowing your specific context.

  1. There has been issues reported with 9600 baud in particular (see closed issues) but has been since fixed.

  2. Esp8266 pulls the software serial code from some commit (not necessarily the latest AFAIK). So, you may need to download the latest version, and not just put it in libraries, but probably go to the ESP folder and replace the existing version

  3. I am not sure if this is true or not, but if the buffer size is less than the actual length of payload being tranmitted, things get messy towards the end. I am saying this because after playing around with many settings, changing the buffer size did seem to have an effect.

  4. Hmm there is no Latest windows version 1.6.1-p1.zip doesn't seem to compile #4 :P

@viswanadh401
Copy link
Author

viswanadh401 commented Jul 11, 2018

I used the following library for software serial.. https://github.com/plerup/espsoftwareserial
and here the code..

#include <SoftwareSerial.h>

SoftwareSerial swSer(12, 14, false, 256);

void setup() {
Serial.begin(9600);
swSer.begin(9600);
Serial.println("\nSoftware serial test started");
swSer.println("");
}

void loop() {
while (swSer.available() > 0) {
Serial.write((char)swSer.read());
}
}

@RudyFiero
Copy link

How about filling out the required information in the Form when you opened the issue?

----------------------------- Delete below -----------------------------

If your issue is a general question, starts similar to "How do I..", is related to 3rd party libs, or is related to hardware, please discuss at a community forum like esp8266.com.

INSTRUCTIONS

If you do not follow these instructions, your issue may be dismissed.

  1. Follow the checklist under Basic Infos and fill in the [ ] spaces with an X.
  2. Fill in all the fields under Platform and Settings in IDE marked with [ ] (pick the correct option for you in each case, delete the others).
  3. If you haven't already done so, test your issue against current master branch (aka latest git), because it may have been already fixed.
  4. Describe your problem.
  5. If you have a STACK DUMP decode it:

https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html

  1. Include a Minimal Complete Reproducible Example sketch that shows your issue. Do not include your entire project, or a huge piece of code.
  2. Include debug messages:

https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html

  1. Use markup (buttons above) and the Preview tab to check what the issue will look like.
  2. Delete these instructions from the above to the below marker lines before submitting this issue.

----------------------------- Delete above -----------------------------

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12|ESP-01|ESP-07|ESP8285 device|other]
  • Core Version: [latest git hash or date]
  • Development Env: [Arduino IDE|Platformio|Make|other]
  • Operating System: [Windows|Ubuntu|MacOS]

Settings in IDE

  • Module: [Generic ESP8266 Module|Wemos D1 mini r2|Nodemcu|other]
  • Flash Mode: [qio|dio|other]
  • Flash Size: [4MB/1MB]
  • lwip Variant: [v1.4|v2 Lower Memory|Higher Bandwidth]
  • Reset Method: [ck|nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz|160MHz]
  • Upload Using: [OTA|SERIAL]
  • Upload Speed: [115200|other] (serial upload only)

Problem Description

Detailed problem description goes here.

@RudyFiero
Copy link

RudyFiero commented Jul 11, 2018

@viswanadh401 Why do you think there is a problem with the ESP8266/Arduino repository? Why did you open an issue here? The library that you are using for the software serial is an external component, not a part of this repository?

@devyte
Copy link
Collaborator

devyte commented Jul 11, 2018

There is an issue with the pin interrupt related to waveform/pwm/etc handling that was introduced recently, which may be related. I say may, because I'm not certain, but I suspect it could cause havoc with the delicate timing of softwareserial. There is another issue open where the softwareserial is experiencing a wdt on read.
Having said that, this issue has no useful info that isn't available elsewhere, and the issue template has been completely ignored, so Closing. Please read through the issue template and see the issue POLICY doc for more details.

@devyte devyte closed this as completed Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants