Closed MagnusHerrlin closed 2 years ago
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).
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
Any ideas why this happened?
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 :
then I hit ctl-c to stop it
Hope this helps
Thanks /Magnus
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
So the code is here: https://github.com/OpenLightingProject/ola/blob/93db26dd78e787a31c224de37186d4c12752702c/plugins/uartdmx/UartWidget.cpp#L178-L182 https://github.com/OpenLightingProject/ola/blob/81522a6b1802cdc0bc466f64968a72d0ebb7b993/common/io/ExtendedSerial.cpp#L54-L85
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
// SOURCE: https://blog.mbedded.ninja/programming/operating-systems/linux/linux-serial-ports-using-c-cpp/
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <unistd.h>
int main() {
int serial_port = open("/dev/ttyAMA0", O_RDWR);
struct termios tty;
if(tcgetattr(serial_port, &tty) != 0)
{
printf("Error %i from tcgetattr: %s\n", errno, strerror(errno));
return 1;
}
tty.c_cflag &= ~PARENB;
tty.c_cflag &= ~CSTOPB;
tty.c_cflag &= ~CSIZE;
tty.c_cflag |= CS8;
tty.c_cflag &= ~CRTSCTS;
tty.c_cflag |= CREAD | CLOCAL; tty.c_lflag &= ~ICANON;
tty.c_lflag &= ~ECHO;
tty.c_lflag &= ~ECHOE;
tty.c_lflag &= ~ECHONL;
tty.c_lflag &= ~ISIG;
tty.c_iflag &= ~(IXON | IXOFF | IXANY);
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL);
tty.c_oflag &= ~OPOST;
tty.c_oflag &= ~ONLCR; tty.c_cc[VTIME] = 10;
tty.c_cc[VMIN] = 0;
cfsetispeed(&tty, 250000);
cfsetospeed(&tty, 250000);
if (tcsetattr(serial_port, TCSANOW, &tty) != 0)
{
printf("Error %i from tcsetattr: %s\n", errno, strerror(errno));
return 1;
}
unsigned char msg[] = { 'H', 'e', 'l', 'l', 'o', '\r' };
write(serial_port, "Hello, world!", sizeof(msg));
char read_buf [256]; memset(&read_buf, '\0', sizeof(read_buf));
int num_bytes = read(serial_port, &read_buf, sizeof(read_buf));
if (num_bytes < 0)
{
printf("Error reading: %s", strerror(errno));
return 1;
}
printf("Read %i bytes. Received message: %s", num_bytes, read_buf);
close(serial_port);
return 0;
}
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
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
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.
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: https://github.com/OpenLightingProject/ola/pull/1750
@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.
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
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
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
Hi
Since the installation did not put anything in the /etc/init.d/ folder I copied the one from my old installation but now I'm facing another problem: when I do sudo /etc/init.d/olad start and sudo /etc/init.d/olad status I get
pi@100-Bullseye(rw):~$ sudo /etc/init.d/olad status ● olad.service - LSB: OLA daemon Loaded: loaded (/etc/init.d/olad; generated) Active: active (exited) since Sun 2021-11-14 04:11:30 CET; 52s ago Docs: man:systemd-sysv-generator(8) Process: 8003 ExecStart=/etc/init.d/olad start (code=exited, status=0/SUCCESS) CPU: 27ms
Nov 14 04:11:30 100-Bullseye systemd[1]: Starting LSB: OLA daemon... Nov 14 04:11:30 100-Bullseye olad[8003]: Starting OLA daemon: olad Nov 14 04:11:30 100-Bullseye olad[8007]: /sbin/start-stop-daemon: user 'olad' not found Nov 14 04:11:30 100-Bullseye olad[8008]: failed! Nov 14 04:11:30 100-Bullseye systemd[1]: Started LSB: OLA daemon.
Since I did not install it with apt the user olad was not created so how do I do that? sudo adduser or how? Where is the script that creates this user?
/Magnus
I found an answer to my previous question in /ola/debian/ola.postint line 59
getent passwd olad > /dev/null || adduser --system --no-create-home olad getent group olad > /dev/null || addgroup --system olad groups olad | grep dialout > /dev/null || adduser olad dialout groups olad | grep plugdev > /dev/null || adduser olad plugdev
So I did this and now I have a olad user Another question: on line 65 in this file says: CONF_DIR=/var/lib/ola That's the old location, should'nt it be CONF_DIR=/etc/ola ?
I hooked up a scope today and can confirm that my little hack it is not working the baudrate is not correct, a startbit is around 100uS instead of 4uS
/Magnus
I just tried to compile #1750 and it compiled fine but the result is the same wrong baudrate, a startbit is around 104us.
/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 apt-get install
part and modify the ./configure
flags accordingly.
# 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:
<something something UART something>: Port speeds for <number> are 250000 in and 250000 out
then you're golden - all that remains is recreating the config directory /etc/ola
(I recommend you just back up the one created by an apt-get install ola
on a different system) and giving it the proper owner and permissions and then creating a system service for olad
so that it starts automatically at system boot - essentially what /etc/init.d/olad
is for, except on Ubuntu I'd probably use a systemd
service for it; but we can cross that river when we get there ;-)
Notice that I'm not changing the installation prefix to /usr
- I think that's where apt-get
is supposed to put stuff, whereas things installed manually should go to /usr/local
. And in fact, from a user's perspective, after you're done installing something you rarely need to care about whether it's installed in /usr
or /usr/local
, because both locations' bin
directories are in your $PATH
anyway, so running olad
will just work either way.
Thanks a lot for the information @jahudka I will try this at once. First I will start with a fresh copy and try because I messed something up when I tried the last three times to change a sourcefile and compile, the changes I made did not show up after the compilation. I'm not sure why. But anyway thanks again for the instructions.
Best regards /Magnus
Looking good so far The uarts show up and the log looks like this olad/PluginManager.cpp:195: Trying to start UART native DMX common/io/ExtendedSerial.cpp:82: Port speeds for 19 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/ttyAMA0 olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA0-O-0 to universe 1 common/io/ExtendedSerial.cpp:82: Port speeds for 20 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/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA1-O-0 to universe 2 common/io/ExtendedSerial.cpp:82: Port speeds for 21 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/ttyAMA2 olad/plugin_api/PortManager.cpp:119: Patched 20-/dev/ttyAMA2-O-0 to universe 3 plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD common/io/ExtendedSerial.cpp:82: Port speeds for 22 are 250000 in and 250000 out plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0 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 common/io/ExtendedSerial.cpp:82: Port speeds for 23 are 250000 in and 250000 out plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD common/thread/Thread.cpp:200: Thread , policy SCHED_OTHER, priority 0 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 plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
I will now check it on the scope.
Thanks /Magnus
It's working :-) Thank's a lot @jahudka I just checked with the scope and it looks like before,(the signal is jumping a bit back and forth in time) but should be good enough to drive any dmxdevice.
/Magnus
@MagnusHerrlin that's fantastic news! Thanks a lot for checking with the scope!
Hi all
One last thing before I close this one.
How do I merge this one #1750 and #1680 before compiling it all?
Thanks /Magnus
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...
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 https://github.com/OpenLightingProject/ola/blob/81522a6b1802cdc0bc466f64968a72d0ebb7b993/common/io/ExtendedSerial.cpp#L32 to
#include <sys/ioctl.h>
#define termios asmtermios
#include <asm-generic/termbits.h>
#include <asm-generic/ioctls.h>
#undef termios
and removing #if defined(HAVE_STROPTS_H) && defined(HAVE_TERMIOS2)
statement
For me in rpi4 helps changing this includes
I assume you mean that fixed it @Pshatsillo ?
I'd be particularly interested whether my existing PR also fixes it: https://github.com/OpenLightingProject/ola/pull/1760
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!
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 https://github.com/OpenLightingProject/ola/issues/1749#issuecomment-1007523850, 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
@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: https://github.com/peternewman/ola/compare/0.10-uart-logging...OpenLightingProject:0.10
Nothing obviously relevant from master either: https://github.com/peternewman/ola/compare/0.10-uart-logging...OpenLightingProject:master
Does OLA 0.10 pass configure on your machine? https://github.com/OpenLightingProject/ola/tree/0.10
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
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.
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!
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!
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 $
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
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
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