-
Notifications
You must be signed in to change notification settings - Fork 205
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
Uarts on RPi4 stopped working (Bullseye & ola 0.10.8) #1749
Comments
That's helpful, but please can we see a -l 4 run too (ideally the whole log).
Very little changed regarding this in 0.10.7 to 0.10.8 so it's likely Bullseye.
It's a bit of both, see https://forums.raspberrypi.com/viewtopic.php?p=529321&sid=08a0255f3835e514ae071511741984ae#p529321 Seemingly only UART0 (but presumably the others worked before)?:
Not really, but hopefully we can get to the bottom of it... |
Hi Peter Here's the output from running olad -l 4 -c /etc/ola : Click to expand!
then I hit ctl-c to stop it Hope this helps Thanks |
Thanks, so the relevant bit is:
So the code is here: ola/plugins/uartdmx/UartWidget.cpp Lines 178 to 182 in 93db26d
ola/common/io/ExtendedSerial.cpp Lines 54 to 85 in 81522a6
At a guess, we're in the undefined bit at the bottom for some reason. Are you happy to have a go at compiling from source, that's probably where we need to go to fix this? Probably start off just compiling our master branch (or 0.10 branch) and then when that's working (well compiling but showing the same fault) we can add some debugging and go from there... |
My knowledge about Linux are very limited, in fact what I know so far is what I've learned from using the Raspberry Pis But from what I can read from your code the program either exits on line 61 (Is this when it can not find the device?) However instead of compiling ola from scratch (takes a loong time)
I opened it in Geany made a few changes compiled,built and ran it Btw I tried this on my old installation (Buster), Thanks |
Just tried it on the new installation and it works there too. /Magnus |
It could also be line 82 too (if it can't find termios2).
Yes, it can be slow, but not so bad on a Pi 4 surely (especially if you disable everything you don't need). You'll also have to do this at least once to fix the problem, unless you want to wait for a release from us and then a deb from Raspbian.
https://sourceware.org/legacy-ml/libc-alpha/2019-04/msg00200.html termios2 is just a struct. You could try merging our code into your example and testing like that. |
I'm not sure if you get a ping automatically from a link @MagnusHerrlin but it looks like the cause has been found, I was half right: |
@MagnusHerrlin if you get a chance, do you want to try compiling #1751 which will confirm exactly why it failed to set the baud rate. |
Hi Peter I would love to help, but I'm not really sure how to compile and install it. So exactly HOW should I do to compile #1751? And another question: say I spent half an hour compiling everything Could'nt I just to go into /ola/plugins/uartdmx/ and compile or make this part and then link everything together? Am I wrong about this? Best regards |
Hi I installed gh from github gh pr checkout 1751 cd .. and the result is: But the uarts still don't show up in the webinterface. /Magnus |
So I tried someting else I changed UartWidget.cpp /* do the port settings */ if (tcgetattr(m_fd, &my_tios) < 0) { // get current settings my_tios.c_cflag |= CLOCAL; // port is local, no flow control cfsetispeed(&my_tios, 250000); if (tcsetattr(m_fd, TCSANOW, &my_tios) < 0) { // apply settings /* Do the platform-specific initialisation of the UART to 250kbaud */ and did a make -j 4 all and this time I could select the Uarts in the webinterface But I can also see a strange chase effect between the outputs if i set all channels to zero I tried to put a video here but you could not see it, so I removed it. However here's the output from olad -l 4 olad/PluginManager.cpp:195: Trying to start UART native DMX All the best |
Hi Since the installation did not put anything in the /etc/init.d/ folder I copied the one from my old installation pi@100-Bullseye(rw):~$ sudo /etc/init.d/olad status Nov 14 04:11:30 100-Bullseye systemd[1]: Starting LSB: OLA daemon... Since I did not install it with apt the user olad was not created /Magnus |
I found an answer to my previous question in /ola/debian/ola.postint line 59 #create the olad user, add it to groups So I did this and now I have a olad user I hooked up a scope today and can confirm that my little hack it is not working /Magnus |
I just tried to compile #1750 /Magnus |
@MagnusHerrlin you can try compiling PR #1750 which contains a sort of hotfix for the issue that seems to be causing this if you need to get working UARTs asap. I seem to be getting a working installation with this setup; I haven't been able to test it properly yet since I don't have access to an oscilloscope and my UART to RS-485 module hasn't arrived yet, so for now I've only been able to test that sending DMX data from OLA over UART to an ESP8266 UART configured as a DMX input and then back over ArtNet to a second universe in OLA works as expected (2nd universe shows the same values in DMX Monitor as I set in 1st universe's DMX console), so I'm assuming either both devices' baud rates must be correct, or both must be wrong exactly the same way (which I hope is unlikely), otherwise I'd see garbage at the end. These steps work for me on a fresh copy of Ubuntu Server 21.10 for RPi and only with the selection of plugins which I need; if you need other plugins you need to add the necessary dependencies to the # get build & plugin dependencies
sudo apt-get install libcppunit-dev libcppunit-1.15-0 uuid-dev pkg-config libncurses5-dev \
libtool autoconf automake g++ libmicrohttpd-dev libmicrohttpd12 protobuf-compiler \
libprotobuf-lite23 libprotobuf-dev libprotoc-dev zlib1g-dev bison flex make \
libftdi-dev libftdi1-dev libftdi1 libusb-1.0-0-dev liblo-dev libavahi-client-dev
# get the code from the appropriate branch from my fork
git clone --depth 1 --branch jahudka-fix-missing-stropts-h https://github.com/jahudka/ola.git
cd ola
# voodoo, I'm assuming this prepares the build environment somehow
autoreconf -i
# this is where you select plugins and other features
./configure --disable-dmx4linux --disable-dummy --disable-e131 --disable-espnet \
--disable-gpio --disable-karate --disable-kinet --disable-milinst --disable-openpixelcontrol \
--disable-pathport --disable-renard --disable-sandnet --disable-shownet --disable-spi \
--disable-stageprofi --disable-usbpro
# this is the part where you get multiple coffees and read a book or two
make -j 4
# this also takes a while
sudo make install
# this I think updates the database of shared libraries so binaries on your system, including
# OLA itself, can find them, I think at one point my attempts at debugging were foiled by
# not doing this after a "make install"
sudo ldconfig
# this creates the appropriate system user and adds it to the appropriate groups
sudo adduser --system --no-create-home olad
sudo addgroup --system olad
sudo adduser olad dialout
sudo adduser olad plugdev
# then you may or may not need to update /boot/firmware/config.txt
# and / or /boot/firmware/cmdline.txt in order to free up the UART port(s)
# from other parts of the system which might be using it, such as
# the serial console or the Bluetooth module, I'm not sure what
# the situation is on a Pi 4 as I'm on a 3B+; then you also might need
# to add & apply the udev rules from the "debian/ola.udev" file in this repo,
# otherwise plugins might not see the devices they should...
# ...and finally you should be able to run:
sudo -u olad olad --log-level 3 If all of that works for you and you get a line in your output reading something like:
then you're golden - all that remains is recreating the config directory Notice that I'm not changing the installation prefix to |
Thanks a lot for the information @jahudka Best regards |
Looking good so far I will now check it on the scope. Thanks |
It's working :-) /Magnus |
@MagnusHerrlin that's fantastic news! Thanks a lot for checking with the scope! |
I'm glad you're presumably sorted @MagnusHerrlin , but I'm going to re-open this until we get a fix merged in for this issue as other people are asking about it still... |
Essentially just include a different combination of headers, but add some required cotton wool around this. Closes OpenLightingProject#1749 With huge thanks to @plugz for mcallegari/qlcplus@5116d98
So I finally got time and Pi access, to have a look at this, I didn't get anywhere useful with my own work, including the undef route, but some creative searching found the answer was very simple for our particular use case! @MagnusHerrlin @jahudka @MarcHagen or anyone else who's interested, the PR ( #1760 ) needs testing please; I've configured my Pi correctly, and it finds the port, but I don't have access to any DMX hardware or a scope currently, and I don't have a hat/shield for DMX output either. I've no reason to think it won't work, but want it checked before merging... |
For me in rpi4 helps changing this includes ola/common/io/ExtendedSerial.cpp Line 32 in 81522a6
to
and removing |
I assume you mean that fixed it @Pshatsillo ? I'd be particularly interested whether my existing PR also fixes it: As I think it's a little cleaner (and safer for a broader range of OSes) as well as not requiring the define/undef workarounds. |
Thank You! |
Does that mean it works then @Pshatsillo ? I'm hoping someone can test it before I merge it... |
I will test it within couple days
пт, 7 янв. 2022 г., 19:00 Peter Newman ***@***.***>:
… Thank You!
Does that mean it works then @Pshatsillo <https://github.com/Pshatsillo>
? I'm hoping someone can test it before I merge it...
—
Reply to this email directly, view it on GitHub
<#1749 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACN7SHLNWYYJ2A675N2W3PDUU4E2VANCNFSM5H3NY2NQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@peternewman, your fork when ./configure throw error "configure: error: Missing cppunit, please install >= 1.9.6", but it installed in system. It happened without any prefixes. Latest OLA branch configuring without problems |
Can you share the config.log ? Which OLA branch are you using that works? There's nothing missing from that which is in 0.10: Nothing obviously relevant from master either: Does OLA 0.10 pass configure on your machine? |
I use master branch. OLA 0.10 fails with same error. If i made your changes in both files manually everything works perfect. I will try again |
So that's not 0.10 branch:
It's not even my 0.10 branch; I don't know if you haven't done
That's great news, and all that really matters! I assume when you say perfectly you've used the UART output itself as opposed to just got it to compile as intended? If so that's good enough for me for it to be merged. |
Yes, it seems my mistake with checkout branches. Now configure in your branch was success. Waiting when compilation ends... UPD: Everything is fine! Thank you! |
Just to be explicit, do you mean DMX output works again too? Do you have any scope or ability to confirm it's doing the correct frame/baud rate again? |
Yes, led is flashing on master, tomorrow I will try to connect DMX dimmer to my RPI cm4 |
Everything is fine and work perfect!
|
Hi I just compiled and installed #1760 and it is working fine I also checked with a scope everything is looking fine. #dtoverlay=disable-bt please note even the line with the baudrate setting is commented out. I only use uart2 to uart5 dtoverlay=uart2 and the baudrate is still correct on the used ports However when I run olad with --log-level 3 Thanks |
Thanks for testing all, I've merged that now! |
@MagnusHerrlin I've opened #1762 for your other issue. |
Hi
After a fresh install of RpiOs Bullseye and sudo apt install ola (v0.10.8)
the uarts on the pi4 stopped working.
When i stop the olad daemon and intead
run olad -l 2 -c /etc/ola i get this output:
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
plugins/uartdmx/UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
plugins/uartdmx/UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
plugins/uartdmx/UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
plugins/uartdmx/UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
plugins/uartdmx/UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA4
On my old installation (Buster & ola v0.10.7) everything is working
now the question is what make it break?
Is it the upgrade to Bulleye or the upgrade of ola from 0.10.7 to 0.10.8?
I'm a bit confused about the init_uart_clock=16000000
does this set the clock for ttyAMA0 or for all uarts?
or is it the plugin that sets the baudrate?
(it seems like it from the errors above).
So the upgrade worked as a downgrade
The Pi4 now have instead of having 4 more uarts than a pi3 have one less (0).
Any ideas why this happened?
Thanks
/Magnus
The text was updated successfully, but these errors were encountered: