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
250k Baud communication #15
Comments
i did some more investigation. To reset the arduino i need to toggle Nerves.UART.set_dtr(pid, boolean) twice (1. false, 2. true).
now i can see all message written by arduino on boot, but it seems like the used baud rate isn't right. I checked again with the arduino IDE, everything works fine with 250k baud there. edit: I expect to get around 906chars, but read returns only 36. |
I suspect that the custom baud rate code isn't quite right: https://github.com/nerves-project/nerves_uart/blob/master/src/uart_comm_unix.c#L185 I hardly ever use custom baud rates and even less so on OSX. If you're not afraid to dive into the C code, I might try hardcoding |
Thanks for the hint. I just checked if the call to set_custom_speed did was i was expecting. Which is does. In the end, it works with Arduino on this machine. I'll try to fix the c code, if i can. |
Ok, i found two variants that work out. First Variant: set the speed in
Second Variant: set speed via ioctl after tcsetattr
Which version would you prefer @fhunleth? Or do you have any feedback? Would love to create a (pull|merge)-request afterwards. |
as a side note, in both variants passive mode seems not to work anymore, independent of configuration passed to UART.open it will always end in active mode. |
Awesome! (Well except for the passive mode issue - that's weird) Code-wise I like the My concern is that this is serial driver-specific and maybe both |
I still need to find a bug.
as you can see, i get an |
When this is figured out, I'll make a new |
So far i didn't manage to figure out how to solve My C-FU isn't that good, as it seems. |
Hey - I programmed an Arduino Uno to output at 250000 baud and connected it to my Mac. I think that I have something that may work for you. Could you try out my |
Yeah, works and without the active:
passive:
|
Thanks for verifying! I'm going to merge and push out an updated release. |
Hej there,
i try to communicate with a Chinese Arduino Mega 2560 (250000 Baud).
As a precheck i used the arduino IDE serial monitor and sending "G28\r\n", which worked.
After that i tried to play around with nerves_uart in a iex session.
Which doesn't result in what i was expecting. Did i miss something?
Something i observed: starting the arduino serial monitor will reset the mega2560. But it should work none the less right?
Edit: On first glimpse it looks like the provided nerves uart c-code handles custom baud rates. But i couldn't find any example using it. Maybe it's not working?
The text was updated successfully, but these errors were encountered: