-
Notifications
You must be signed in to change notification settings - Fork 13.3k
A small nothing left aside. serialEvent() #752
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
Comments
I never new about it, thanks for pointing this out. serialEvent() is not compatible with the Esplora, Leonardo, or Micro So it's not even supported by some of the Arduino brand boards. On Sun, Sep 6, 2015, 22:39 Frédéric Plante [email protected] wrote:
|
Might as well be more discipline then them. ;) Esplora, Leonardo, or Micro are basically all Léonardo tech, that is made to become computer interface(mouse, keyboard, SPI and I2c interface that that lack on a computer) using usb. While all the other arduinos of the first génération, the one using an external UART2USB (MEGA and Tiny) are made to be small stand alone computing device, that can totally function without serial port, except for programming, well that is what i deduce of what I get out of the product. According to me, the emphasis of the SerialEvent() should of been put on the Léonardo class, and less on the stand alone class, but they did not think about it that way. Any ways, according to me both should have it, there is never enough possible internal trigger and external interrupt. Take care. |
Is there any notable library that uses SerialEvent()? I see no advantage over calling a method directly from the loop Most users, particularly casual users, will never use interrupts (apart form library code) and the SerialEvent() runs like an interrupt with some of the associated problems. I note even on the boards the support SerialEvent() it is not uniform, Mega does not have it, instead having SerialEvent1(), etc. |
Actually, the sérialevent() event is absolutly independant from the Loop() it's never call from there. T'it's actually the library that manage to trigger event by calling SerialEvent(), in the sketch, from the library. pretty much the same way the when you hook a interupt to a function. Actually, i think that it's the Uart on the Arduino that interupt and get the serialevents call. A couple of the sketch exemple use it, and there are a few library also. Actually mini, uno, mega128 and mega256, and all the clone, has it. It is the atmega32u that does handle the event. Has for Due and Zero, im not sure. I think it's important to put it in, to make sure that the new guy that try esp and Adruino ide together get the same look and feel as if it was a real Arduino. Just saying. I look at your work, and I see that you are trying to make it as transparent as possible, well there is a spot there. ;) |
Anything new on this? I'd be glad to see this coming!
I disagree. In my experience, almost everyone who programmed an Arduino, AtMega or MSP will use interrupts if available. And these are the users which will use Arduino on ESP8266. Best regards |
👍 |
Hi, is SerialEvent() Available now?. im trying to send information via serial from arduino to esp and back the other way, ESP is acting as a web server so if use serial.read is going to block all the others function. Any suggestions? Best Regards. |
I knew this was going to come up. It's not because it seam useless for some that it is for every one. I will take a look at the progress [...] [...] Well I check at the https://github.com/esp8266/Arduino/blob/master/cores/esp8266/HardwareSerial.h at line 146 and line 147 the procedure seam to be put in place.
part that will call the Serial event from the library in the sketch when the stuff is available, is still missing This part:
Should be added in the: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/HardwareSerial.cpp I've put the lines for Serial1, but I don't think that it would be really useful, since there is not Rx line on that port. Basically, only Serial0 need to pull an interruption when selected events happen. |
Is it possible to modify that myself? I cant find that file/folder on my pc. (sorry if its a stupid question, Im a noob, barely I understand how library works) Best Regards. |
Yeah! probably, if you know where your arduino platform distribution is, you can change it no problem. But every time you will reinstall, you will loose all, same when they will update. Best would be to change at the root, but for some reason, some people think that if it's useless for them, it has to be the same for every one. :( |
Hey, I know where it its, but i cant find the file it should be on libraries right???? did you make it work? |
I'm also out of luck, can't find the location of the files on my disk. Edit: Nvm,, using the git version now. Best Regards |
Is there still an idea to reimplement serialEvent? It is not interrupt driven as in this snippet from main.cpp: for (;;) {
loop();
if (serialEventRun) serialEventRun();
} Obviously, it does add some overhead for those who haven't got serialEvent defined. |
@fredericplante when you added those lines you commented to make the serialEvent to work were you working on ESP8266 Arduino version 2.3? Was it all you added? Could you make a pull request please? I'm asking that because I've made those changes and the serialEvent still not been called. |
@igrr I'm rather confused with this one. Was the HardwareSerial code massively changed? The code references in this thread don't match with the current code for HardwareSerial for me. |
Hello, I saw in the post history the adjustment in the Lib to support SerialEvent, it is a function very used in projects. I would like to know if this improvement will be incorporated or is it more appropriate to use the Ticker to execute Serial.available? |
Humm good question! rsegecin, what was the actual platform in 2015? To be honest, I'm back to University and it takes a good part of my life. lol But it's summer time now, baby :D I will get back to programming, I have a whole lot of modules I received during the winter, many use Serial to communicate. Compulsive buying did not go away, unlike coding, during those long hours of study, ;) I will give news within the near future. |
While you could use Ticker to execute Disclaimer: I didn't look into the inner workings of schedule yet. You'll have to reschedule after calling but I don't know if it's possible from within the called function. |
@bertmelis @laercionit This is part of my CommandExecutor class, I use it also with Serial.
|
Arduino 1.8.7 and ESP for Arduino 2.4.0 : |
Until we have a real
|
Tiny typo in German
Hi guys, almost 5 years have passed since this issue was reported and looks like it is still not solved. Is there any perspective that this would be resolved any time soon? Don't take me wrong...I understand that there are a lot of voluntary work and people need to accommodate this work with their schedules, but would be nice to have an update on this issue. |
Match the AVR SerialEvent implicit callback. Callback is executed in normal user mode, not IRQ, so standard processing can be uses. Fixes esp8266#752 after 5 years. :)
@ttkdroid please report in the PR if it works/fails. It seems pretty trivial and not all that useful, honestly. |
* Add SerialEvent() callback to loop processing Match the AVR SerialEvent implicit callback. Callback is executed in normal user mode, not IRQ, so standard processing can be uses. Fixes #752 after 5 years. :) * Fix style
I, you guys seeem to forgot the serialEvent() trigger, that is required to be fully compatible with the basics example of the Arduino IDE.
I guess we could just program a trigger from within the program, you while you guys are at it, well here is the constructive remark ;)
Thanx :)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: