You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uarts on RPi4 stopped working (Bullseye & ola 0.10.8) #1749
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).
When i stop the olad daemon and intead run olad -l 2 -c /etc/ola i get this output:
That's helpful, but please can we see a -l 4 run too (ideally the whole log).
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?
Very little changed regarding this in 0.10.7 to 0.10.8 so it's likely Bullseye.
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).
Here's the output from running olad -l 4 -c /etc/ola :
Thanks, so the relevant bit is:
olad/PluginManager.cpp:195: Trying to start UART native DMX
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /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/ttyAMA0
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /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/ttyAMA1
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /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/ttyAMA2
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /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/ttyAMA3
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA4
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
olad/PluginManager.cpp:200: Started UART native DMX
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
and searching the internet.
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?)
or line 69(Failed to set the baudrate?)
However instead of compiling ola from scratch (takes a loong time)
I found this program to test the ports
I opened it in Geany made a few changes compiled,built and ran it
and with a link between Tx and Rx I can read the transmitted text.
Btw I tried this on my old installation (Buster),
I will now transfer the file to the new installation and try it again.
(Hopefully we can get some useful info out of that)
Just tried it on the new installation and it works there too.
The difference I can see is that the test prog use termios.h
and ola termios2
I wonder what the differece is, back to Google.
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?) or line 69(Failed to set the baudrate?)
It could also be line 82 too (if it can't find termios2).
However instead of compiling ola from scratch (takes a loong time) I found this program to test the ports
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.
Just tried it on the new installation and it works there too. The difference I can see is that the test prog use termios.h and ola termios2 I wonder what the differece is, back to Google.
I would love to help, but I'm not really sure how to compile and install it.
I have tried for the last two days trying to compile ola,
The first attempts installed ola in /usr/local/bin and this is not where it is installed when done via apt
so I tried with ./config --prefix=/usr --exec-prefix=/usr and that installed it in the right place.
then I did make -j 4 all and waited,
and it compiled without errors (but a lot of warnings about auto_ptr something)
then a sudo make install and
sudo ldconfig
It could run it but the whole system got very unstable and the web interface took a long time to load.
I also noticed that the file in /etc/init.d/olad did not exist. why?
from what I read you should do a debuild but that command could not be found and I could not install in with apt.
So exactly HOW should I do to compile #1751?
How can I download or switch to this branch?
I am having a hard time trying to understand how to work with git (even though I watched several tutorials).
So if you could tell me how I should do to get #1751 and compile it and install it in the right directories
it would be great.
And another question: say I spent half an hour compiling everything
and I make some changes in /ola/plugins/uartdmx/UartWidget.cpp
do I have to compile everything again?
Could'nt I just to go into /ola/plugins/uartdmx/ and compile or make this part and then link everything together?
because all the other objectfiles are already compiled, its just the linking/install step that remains.
gh pr checkout 1751
./autoreconf -i
Here I uncommented line 3 in /etc/apt/sources.list
sudo apt update
sudo apt build-dep ola
sudo apt install flake8
autoreconf -i
./configure --prefix=/usr --exec-prefix=/usr
git status // to check if in the right branch
make -j 4 all
sudo make install
sudo ldconfig
cd ..
olad -l 4
and the result is:
olad/PluginManager.cpp:195: Trying to start UART native DMX
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA0
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA1
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA2
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA3
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA4
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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
olad/PluginManager.cpp:200: Started UART native DMX
But the uarts still don't show up in the webinterface.
if (tcgetattr(m_fd, &my_tios) < 0) { // get current settings
OLA_WARN << "Failed to get POSIX port settings";
return false;
}
cfmakeraw(&my_tios); // make it a binary data port
my_tios.c_cflag |= CLOCAL; // port is local, no flow control
my_tios.c_cflag &= ~CSIZE;
my_tios.c_cflag |= CS8; // 8 bit chars
my_tios.c_cflag &= ~PARENB; // no parity
my_tios.c_cflag |= CSTOPB; // 2 stop bit for DMX
my_tios.c_cflag &= ~CRTSCTS; // no CTS/RTS flow control
if (tcsetattr(m_fd, TCSANOW, &my_tios) < 0) { // apply settings
OLA_WARN << "Failed to set POSIX port settings";
return false;
}
/* Do the platform-specific initialisation of the UART to 250kbaud */
// if (!ola::io::LinuxHelper::SetDmxBaud(m_fd)) {
// OLA_WARN << "NEW Failed to set baud rate to 250k";
// return false;
// }
and did a make -j 4 all
and got the answer to my previous question
since it only compiled the changes
then I did a
sudo make install
and
sudo ldconfig
and this time I could select the Uarts in the webinterface
I have'nt had time to verify the baudrate with a scope yet,
I only have leds connected to the outputs,
but I can see a change when I set all channels to 0 or full
But I can also see a strange chase effect between the outputs if i set all channels to zero
Not sure what this is coming from
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
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA0
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA0
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA0
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA0-O-0 to universe 1
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA1
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA1
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA1
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA1-O-0 to universe 2
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA2
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA2
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA2
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA2
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA2-O-0 to universe 3
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA3
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA3
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA3
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA3-O-0 to universe 4
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA4
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA4
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA4
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA4-O-0 to universe 5
olad/PluginManager.cpp:200: Started UART native DMX
common/io/EPoller.cpp:306: ss process time was 0.000004
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000002
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
@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
@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
I use master branch. OLA 0.10 fails with same error. config.log
So that's not 0.10 branch:
It was created by OLA configure 0.9.8, which was
generated by GNU Autoconf 2.69.
It's not even my 0.10 branch; I don't know if you haven't done autoreconf -i or there's some old cached one or something.
If i made your changes in both files manually everything works perfect.
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.
pi@raspberrypi:~/ola/olad $ ./olad -l 3 --http-data-dir /home/pi/ola/olad/www
olad/Olad.cpp:98: OLA Daemon version 0.10.8
olad/OlaDaemon.cpp:121: Using configs in /home/pi/.ola
common/thread/Thread.cpp:200: Thread pref-saver, policy SCHED_OTHER, priority 0
common/file/Util.cpp:134: Could not open /usr/local/share/ola/pids: No such file or directory
common/rdm/PidStoreLoader.cpp:79: Failed to list files in /usr/local/share/ola/pids
olad/OlaServer.cpp:173: No PID definitions loaded
olad/OlaServer.cpp:194: Server UID is 7a70:e61ea8c0
olad/OlaServer.cpp:206: Server instance name is OLA Server
olad/plugin_api/Preferences.cpp:436: Missing /home/pi/.ola/ola-universe.conf: No such file or directory - this isn't an error, we'll just use the defaults
common/thread/Thread.cpp:200: Thread http, policy SCHED_OTHER, priority 0
olad/OlaServer.cpp:481: Updated PID definitions.
olad/OlaServer.cpp:489: PID store is at 0
common/http/HTTPServer.cpp:509: HTTP Server started on port 9090
common/thread/Thread.cpp:200: Thread signal-thread, policy SCHED_OTHER, priority 0
olad/PluginManager.cpp:195: Trying to start Dummy
olad/plugin_api/DeviceManager.cpp:105: Installed device: Dummy Device:1-1
olad/PluginManager.cpp:200: Started Dummy
olad/PluginManager.cpp:195: Trying to start ArtNet
olad/plugin_api/DeviceManager.cpp:105: Installed device: ArtNet [192.168.30.230]:2-1
olad/PluginManager.cpp:200: Started ArtNet
olad/PluginManager.cpp:195: Trying to start ShowNet
olad/plugin_api/DeviceManager.cpp:105: Installed device: ShowNet [192.168.30.230]:3-1
olad/PluginManager.cpp:200: Started ShowNet
olad/PluginManager.cpp:195: Trying to start ESP Net
olad/plugin_api/DeviceManager.cpp:105: Installed device: ESP Net [192.168.30.230]:4-1
olad/PluginManager.cpp:200: Started ESP Net
olad/PluginManager.cpp:195: Trying to start Serial USB
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
olad/PluginManager.cpp:200: Started Serial USB
olad/PluginManager.cpp:195: Trying to start Enttec Open DMX
common/io/IOUtils.cpp:39: open(/dev/dmx0): No such file or directory
plugins/opendmx/OpenDmxPlugin.cpp:80: Could not open /dev/dmx0 No such file or directory
olad/PluginManager.cpp:200: Started Enttec Open DMX
olad/PluginManager.cpp:195: Trying to start SandNet
olad/plugin_api/DeviceManager.cpp:105: Installed device: SandNet [192.168.30.230]:7-1
olad/PluginManager.cpp:200: Started SandNet
olad/PluginManager.cpp:195: Trying to start StageProfi
olad/PluginManager.cpp:200: Started StageProfi
olad/PluginManager.cpp:195: Trying to start Pathport
olad/plugin_api/DeviceManager.cpp:105: Installed device: Pathport [192.168.30.230]:9-1
olad/PluginManager.cpp:200: Started Pathport
olad/PluginManager.cpp:195: Trying to start E1.31 (sACN)
olad/plugin_api/DeviceManager.cpp:105: Installed device: E1.31 (DMX over ACN) [192.168.30.230]:11-1
olad/PluginManager.cpp:200: Started E1.31 (sACN)
olad/PluginManager.cpp:195: Trying to start SPI
olad/PluginManager.cpp:200: Started SPI
olad/PluginManager.cpp:195: Trying to start KiNET
olad/plugin_api/DeviceManager.cpp:105: Installed device: KiNet Device:16-1
olad/PluginManager.cpp:200: Started KiNET
olad/PluginManager.cpp:195: Trying to start KarateLight
common/io/IOUtils.cpp:39: open(/dev/kldmx0): No such file or directory
plugins/karate/KaratePlugin.cpp:79: Could not open /dev/kldmx0 No such file or directory
olad/PluginManager.cpp:200: Started KarateLight
olad/PluginManager.cpp:195: Trying to start Milford Instruments
olad/PluginManager.cpp:200: Started Milford Instruments
olad/PluginManager.cpp:195: Trying to start Renard
olad/PluginManager.cpp:200: Started Renard
olad/PluginManager.cpp:195: Trying to start UART native DMX
common/io/ExtendedSerial.cpp:96: Port speeds for 28 are 250000 in and 250000 out
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA1
olad/PluginManager.cpp:200: Started UART native DMX
olad/PluginManager.cpp:195: Trying to start Open Pixel Control
olad/PluginManager.cpp:200: Started Open Pixel Control
olad/PluginManager.cpp:195: Trying to start GPIO
olad/PluginManager.cpp:200: Started GPIO
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
olad/plugin_api/PortManager.cpp:119: Patched 2-1-O-0 to universe 5555
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA1-O-0 to universe 5555
olad/plugin_api/Universe.cpp:286: Added source client, 0x608c40 to universe 5555
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
plugins/artnet/ArtNetNode.cpp:1784: Artnet RDM discovery complete
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
olad/plugin_api/Universe.cpp:439: Removed Stale Client
common/io/Serial.cpp:151: Device /dev/ttyUSB0 doesn't exist, so there's no point trying to acquire a lock
^Ccommon/thread/SignalThread.cpp:115: Received signal: Interrupt
common/http/HTTPServer.cpp:536: Notifying HTTP server thread to stop
common/http/HTTPServer.cpp:538: Waiting for HTTP server thread to exit
common/http/HTTPServer.cpp:540: HTTP server thread exited
pi@raspberrypi:~/ola/olad $
I just compiled and installed #1760 and it is working fine I also checked with a scope everything is looking fine.
Then I made a test to leave the first serialport alone and use it for bluetooth instead
so I commented out the following in /boot/config.txt
and the baudrate is still correct on the used ports
However when I run olad with --log-level 3
I get a lot of errors about the uart that is not in use:
plugins/uartdmx/UartWidget.cpp:129: /dev/ttyAMA0 Short or failed write!
the port It is not patched to any universe.
but anyway its working.
Activity
peternewman commentedon Nov 11, 2021
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)?:
https://www.raspberrypi.com/documentation/computers/config_txt.html#init_uart_clock
Not really, but hopefully we can get to the bottom of it...
MagnusHerrlin commentedon Nov 11, 2021
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
/Magnus
peternewman commentedon Nov 11, 2021
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...
MagnusHerrlin commentedon Nov 12, 2021
My knowledge about Linux are very limited, in fact what I know so far is what I've learned from using the Raspberry Pis
and searching the internet.
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?)
or line 69(Failed to set the baudrate?)
However instead of compiling ola from scratch (takes a loong time)
I found this program to test the ports
I opened it in Geany made a few changes compiled,built and ran it
and with a link between Tx and Rx I can read the transmitted text.
Btw I tried this on my old installation (Buster),
I will now transfer the file to the new installation and try it again.
(Hopefully we can get some useful info out of that)
Thanks
/Magnus
MagnusHerrlin commentedon Nov 12, 2021
Just tried it on the new installation and it works there too.
The difference I can see is that the test prog use termios.h
and ola termios2
I wonder what the differece is, back to Google.
/Magnus
peternewman commentedon Nov 12, 2021
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.
peternewman commentedon Nov 13, 2021
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:
#1750
peternewman commentedon Nov 13, 2021
@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.
MagnusHerrlin commentedon Nov 13, 2021
Hi Peter
I would love to help, but I'm not really sure how to compile and install it.
I have tried for the last two days trying to compile ola,
The first attempts installed ola in /usr/local/bin and this is not where it is installed when done via apt
so I tried with ./config --prefix=/usr --exec-prefix=/usr and that installed it in the right place.
then I did make -j 4 all and waited,
and it compiled without errors (but a lot of warnings about auto_ptr something)
then a sudo make install and
sudo ldconfig
It could run it but the whole system got very unstable and the web interface took a long time to load.
I also noticed that the file in /etc/init.d/olad did not exist. why?
from what I read you should do a debuild but that command could not be found and I could not install in with apt.
So exactly HOW should I do to compile #1751?
How can I download or switch to this branch?
I am having a hard time trying to understand how to work with git (even though I watched several tutorials).
So if you could tell me how I should do to get #1751 and compile it and install it in the right directories
it would be great.
And another question: say I spent half an hour compiling everything
and I make some changes in /ola/plugins/uartdmx/UartWidget.cpp
do I have to compile everything again?
Could'nt I just to go into /ola/plugins/uartdmx/ and compile or make this part and then link everything together?
because all the other objectfiles are already compiled, its just the linking/install step that remains.
Am I wrong about this?
Best regards
/Magnus
MagnusHerrlin commentedon Nov 13, 2021
Hi
I installed gh from github
then did this
gh pr checkout 1751
./autoreconf -i
Here I uncommented line 3 in /etc/apt/sources.list
sudo apt update
sudo apt build-dep ola
sudo apt install flake8
autoreconf -i
./configure --prefix=/usr --exec-prefix=/usr
git status // to check if in the right branch
make -j 4 all
sudo make install
sudo ldconfig
cd ..
olad -l 4
and the result is:
olad/PluginManager.cpp:195: Trying to start UART native DMX
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA0
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA1
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA2
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA3
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA4
common/io/ExtendedSerial.cpp:84: Failed to set baud rate, due to missing stropts.h or termios2
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
olad/PluginManager.cpp:200: Started UART native DMX
But the uarts still don't show up in the webinterface.
/Magnus
MagnusHerrlin commentedon Nov 14, 2021
So I tried someting else
I changed UartWidget.cpp
to this
/* do the port settings */
if (tcgetattr(m_fd, &my_tios) < 0) { // get current settings
OLA_WARN << "Failed to get POSIX port settings";
return false;
}
cfmakeraw(&my_tios); // make it a binary data port
my_tios.c_cflag |= CLOCAL; // port is local, no flow control
my_tios.c_cflag &= ~CSIZE;
my_tios.c_cflag |= CS8; // 8 bit chars
my_tios.c_cflag &= ~PARENB; // no parity
my_tios.c_cflag |= CSTOPB; // 2 stop bit for DMX
my_tios.c_cflag &= ~CRTSCTS; // no CTS/RTS flow control
cfsetispeed(&my_tios, 250000);
cfsetospeed(&my_tios, 250000);
if (tcsetattr(m_fd, TCSANOW, &my_tios) < 0) { // apply settings
OLA_WARN << "Failed to set POSIX port settings";
return false;
}
/* Do the platform-specific initialisation of the UART to 250kbaud */
// if (!ola::io::LinuxHelper::SetDmxBaud(m_fd)) {
// OLA_WARN << "NEW Failed to set baud rate to 250k";
// return false;
// }
and did a make -j 4 all
and got the answer to my previous question
since it only compiled the changes
then I did a
sudo make install
and
sudo ldconfig
and this time I could select the Uarts in the webinterface
I have'nt had time to verify the baudrate with a scope yet,
I only have leds connected to the outputs,
but I can see a change when I set all channels to 0 or full
But I can also see a strange chase effect between the outputs if i set all channels to zero
Not sure what this is coming from
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
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA0
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA0
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA0
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA0-O-0 to universe 1
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA1
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA1
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA1
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA1
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA1-O-0 to universe 2
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA2
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA2
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA2
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA2
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA2
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA2-O-0 to universe 3
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA3
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA3
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA3
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA3
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA3-O-0 to universe 4
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA4
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA4
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA4
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA4
olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA4-O-0 to universe 5
olad/PluginManager.cpp:200: Started UART native DMX
common/io/EPoller.cpp:306: ss process time was 0.000004
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000002
common/io/EPoller.cpp:306: ss process time was 0.000001
common/io/EPoller.cpp:306: ss process time was 0.000001
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
All the best
/Magnus
17 remaining items
Pshatsillo commentedon Jan 7, 2022
Thank You!
peternewman commentedon Jan 7, 2022
Does that mean it works then @Pshatsillo ? I'm hoping someone can test it before I merge it...
Pshatsillo commentedon Jan 7, 2022
Pshatsillo commentedon Jan 11, 2022
@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
peternewman commentedon Jan 11, 2022
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:
peternewman/ola@0.10-uart-logging...OpenLightingProject:0.10
Nothing obviously relevant from master either:
peternewman/ola@0.10-uart-logging...OpenLightingProject:master
Does OLA 0.10 pass configure on your machine?
https://github.com/OpenLightingProject/ola/tree/0.10
Pshatsillo commentedon Jan 11, 2022
I use master branch. OLA 0.10 fails with same error. If i made your changes in both files manually everything works perfect.
config.log
I will try again
peternewman commentedon Jan 11, 2022
So that's not 0.10 branch:
It's not even my 0.10 branch; I don't know if you haven't done
autoreconf -ior there's some old cached one or something.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.
Pshatsillo commentedon Jan 11, 2022
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!
peternewman commentedon Jan 11, 2022
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?
Pshatsillo commentedon Jan 11, 2022
Yes, led is flashing on master, tomorrow I will try to connect DMX dimmer to my RPI cm4
Pshatsillo commentedon Jan 12, 2022
Everything is fine and work perfect!
MagnusHerrlin commentedon Jan 12, 2022
Hi
I just compiled and installed #1760 and it is working fine I also checked with a scope everything is looking fine.
Then I made a test to leave the first serialport alone and use it for bluetooth instead
so I commented out the following in /boot/config.txt
#dtoverlay=disable-bt
#init_uart_clock=16000000
#enable UART
#enable_uart=1
please note even the line with the baudrate setting is commented out.
I only use uart2 to uart5
dtoverlay=uart2
dtoverlay=uart3
dtoverlay=uart4
dtoverlay=uart5
and the baudrate is still correct on the used ports
However when I run olad with --log-level 3
I get a lot of errors about the uart that is not in use:
plugins/uartdmx/UartWidget.cpp:129: /dev/ttyAMA0 Short or failed write!
the port It is not patched to any universe.
but anyway its working.
Thanks
/Magnus
peternewman commentedon Jan 13, 2022
Thanks for testing all, I've merged that now!
peternewman commentedon Jan 13, 2022
@MagnusHerrlin I've opened #1762 for your other issue.