Cannot send command IR with HotPI - raspberry-pi

I bought a HotPi a while ago, and decided to use it. So I followed the procedure to configure the IR and after a few hours I was able to IR signals on my Raspberry 1.
But my purpose here is to send IR signals, which I tried, without any luck.
So this is the command I try to do (just for test):
irsend SEND_START devinput KEY_POWER ; sleep 3
And this is what lircd tells me:
lircd-0.9.4c[907]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.9.4c[907]: Info: Cannot configure the rc device for /dev/lirc0
lircd-0.9.4c[907]: Error: invalid send buffer
lircd-0.9.4c[907]: Error: this remote configuration cannot be used to transmit
lircd-0.9.4c[907]: Error: error processing command: SEND_START devinput KEY_POWER
lircd-0.9.4c[907]: Error: transmission failed
lircd-0.9.4c[907]: Info: removed client
Edit:
It seems I'm not using the good drivers. According to the HotPi documentation, I'm suppose to use lirc-rpi, which I'm suppos to install with
sudo modprobe lirc-rpi
Which, at least, doesn't return an error. But trying to configure the interface tells me that the driver doesn't exist:
pi#raspberrypi:~ $ mode2 --driver lirc-rpi --device /dev/lirc0
Driver `lirc-rpi' not found. (Missing -U/--plugins option?)
Available drivers:
accent
alsa_usb
asusdh
atilibusb
atwf83
audio
audio_alsa
awlibusb
bte
bw6130
commandir
creative
creative_infracd
default
devinput
dfclibusb
dsp
dvico
ea65
file
ftdi
ftdi-exp
ftdix
girs
i2cuser
irlink
irtoy
livedrive_midi
livedrive_seq
logitech
macmini
mouseremote
mouseremote_ps2
mp3anywhere
mplay
mplay2
pcmak
pinsys
pixelview
samsung
sb0540
silitek
slinke
sonyir
srm7500libusb
tira
tira_raw
udp
uirt2
uirt2_raw
usb_uirt_raw
usbx
zotac

Here is no info what lirc version you are using. There are vast differences between the legacy 0.9.0 still used in some distros and modern lirc.
That said, the logs seems pretty clear. You are using the devinput driver, right? This driver does not support sending data, reflecting the fact that also the kernel doesn't.
You then need to use another driver - first stop might be the default one. If/when using this other driver, you need another lircd.conf.
Please refer to http://lirc.org/html/configuration-guide.html
EDIT: Ah, lirc-0.9.4c says the log. Sorry, my bad. The reply should still be valid, though.

When you record the remote, use:
irrecord -d /dev/lirc0 -f name.conf
The -f uses raw mode. This then worked for me on the transmit side, before I got same error as you.

Related

How to disable Tensorflow js error log for my server host?

As if right now I am in a bit of a rush to get an answer to my problem. The model has been trained and the server works locally with the NN running in the background, but on the server we get the following error message:
2020-04-08 11:54:15.787274: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2799865000 Hz
2020-04-08 11:54:15.787801: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4b5ca00 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-04-08 11:54:15.787830: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
It seems that the server host doesn't like the fact that Tensorflow is trying to log the following error/warning message:
2020-04-08 11:53:42.453164: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to
use: AVX2
Is there a way in JS to disable these error logs so we can run the trained model on the server? Thanks in advance!

Enable FTRACE in ARM to trace realtime characteristic of system

I followed this article to enable FTRACE
https://lwn.net/Articles/365835/
to test a realtime system, my system uses arm cortexa15 (Description: https://mp.renesas.com/en-us/rzg/marketplace/board/RZGB000003.html)
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_STACK_TRACER=y
CONFIG_DYNAMIC_FTRACE=y
But, it didn't work, caused the system hang-up when starting kernel.
Even referred How to Enable or configure ftrace module
I would like to test latency in the realtime system with cyclictest (option -b to trigger FTRACER)
cyclictest -a -t -n -p99 -f -b100
It generated dump message:
INFO: debugfs mountpoint: /sys/kernel/debug/tracing/
WARN: tracing_enabled or tracing_on not found
debug fs not mounted, TRACERs not configured?
could not set ftrace_enabled to 0
FATAL: Can't open /sys/kernel/debug/tracing/available_tracers for reading
I repeated a next step to enable a group of tracer configs:
CONFIG_FTRACE=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FUNCTION_TRACER=y
CONFIG_IRQSOFF_TRACER=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_PREEMPT_TRACER=y
CONFIG_SCHED_TRACER=y
CONFIG_ENABLE_DEFAULT_TRACERS=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
CONFIG_STACK_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_TRACEPOINT_BENCHMARK=y
CONFIG_BACKTRACE_SELF_TEST=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_LL=y
The result still was the same. Kernel hung and didn't show anything.
Anyone who deal with realtime system and Ftrace can help ? Thanks.
I resolve my problem. Below is a part of my defconfig file.
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_TRACEPOINTS=y
CONFIG_STACKTRACE=y
CONFIG_NOP_TRACER=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACE_CLOCK=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_GENERIC_TRACER=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_SCHED_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
CONFIG_STACK_TRACER=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_FTRACE_MCOUNT_RECORD=y
After enabling Ftrace tool, the culprit can then be found in the trace output at /sys/kernel/debug/tracing/trace. The kernel function that was executed just before a latency of more than 100 microseconds was detected is marked with an exclamation mark.

Backport installation script for Broadcom 14e4:43ae wifi controller fails

I recently bought a Lenovo 500-15ACZ notebook and installed Ubuntu 16.04 on it. After the installation I found I couldn't connect to Wifi. When I googled the issue, this seemed to be a common problem for Broadcom wifi cards. I found this question on askubuntu and followed the steps of the answer by Luis Alvarado.
The command lspci -nn -d 14e4: showed me that the pci.id of my device is 14e4:43ae rev 02, which is not yet supported in Linux.
However, there is a script (link to project) on git that tries to solve this via backport:
#!/bin/bash
cd /tmp
git clone https://github.com/kvalo/ath10k-firmware.git
cd ath10k-firmware/QCA9377/hw1.0
sudo mkdir -p /lib/firmware/ath10k/QCA9377/hw1.0
sudo cp board.bin /lib/firmware/ath10k/QCA9377/hw1.0
sudo cp firmware-5.bin_WLAN.TF.1.0-00267-1 /lib/firmware/ath10k/QCA9377/hw1.0/firmware-5.bin
sudo modprobe -r ath10k_pci
cd /tmp
wget https://www.kernel.org/pub/linux/kernel/projects/backports/2015/11/20/backports-20151120.tar.gz
tar -xf backports-20151120.tar.gz
cd backports-20151120
make defconfig-ath10k
make
sudo make install
But when I tried to run this, make threw the following error:
Building backport-include/backport/autoconf.h ... done.
CC [M] /tmp/backports-20151120/compat/main.o
In file included from /tmp/backports-20151120/backport-include/backport/backport.h:7:0,
from :0:
./include/asm-generic/qrwlock.h: In function ‘__qrwlock_write_byte’:
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:28: error: implicit declaration of function ‘config_enabled’ [-Werror=implicit-function-declaration]
#define IS_BUILTIN(option) config_enabled(option)
^
./include/asm-generic/qrwlock.h:156:26: note: in expansion of macro ‘IS_BUILTIN’
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
./include/asm-generic/qrwlock.h:156:37: error: ‘CONFIG_CPU_BIG_ENDIAN’ undeclared (first use in this function)
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:43: note: in definition of macro ‘IS_BUILTIN’
#define IS_BUILTIN(option) config_enabled(option)
^
./include/asm-generic/qrwlock.h:156:37: note: each undeclared identifier is reported only once for each function it appears in
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:43: note: in definition of macro ‘IS_BUILTIN’
#define IS_BUILTIN(option) config_enabled(option)
^
cc1: some warnings being treated as errors
scripts/Makefile.build:294: recipe for target '/tmp/backports-20151120/compat/main.o' failed
make[6]: *** [/tmp/backports-20151120/compat/main.o] Error 1
scripts/Makefile.build:567: recipe for target '/tmp/backports-20151120/compat' failed
make[5]: *** [/tmp/backports-20151120/compat] Error 2
Makefile:1524: recipe for target '_module_/tmp/backports-20151120' failed
make[4]: *** [_module_/tmp/backports-20151120] Error 2
Makefile.build:6: recipe for target 'modules' failed
make[3]: *** [modules] Error 2
Makefile.real:88: recipe for target 'modules' failed
make[2]: *** [modules] Error 2
Makefile:40: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
Makefile:30: recipe for target 'default' failed
make: *** [default] Error 2
CC [M] /tmp/backports-20151120/compat/main.o
In file included from /tmp/backports-20151120/backport-include/backport/backport.h:7:0,
from :0:
./include/asm-generic/qrwlock.h: In function ‘__qrwlock_write_byte’:
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:28: error: implicit declaration of function ‘config_enabled’ [-Werror=implicit-function-declaration]
#define IS_BUILTIN(option) config_enabled(option)
^
./include/asm-generic/qrwlock.h:156:26: note: in expansion of macro ‘IS_BUILTIN’
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
./include/asm-generic/qrwlock.h:156:37: error: ‘CONFIG_CPU_BIG_ENDIAN’ undeclared (first use in this function)
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:43: note: in definition of macro ‘IS_BUILTIN’
#define IS_BUILTIN(option) config_enabled(option)
^
./include/asm-generic/qrwlock.h:156:37: note: each undeclared identifier is reported only once for each function it appears in
return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
^
/tmp/backports-20151120/backport-include/linux/kconfig.h:25:43: note: in definition of macro ‘IS_BUILTIN’
#define IS_BUILTIN(option) config_enabled(option)
^
cc1: some warnings being treated as errors
scripts/Makefile.build:294: recipe for target '/tmp/backports-20151120/compat/main.o' failed
make[5]: *** [/tmp/backports-20151120/compat/main.o] Error 1
scripts/Makefile.build:567: recipe for target '/tmp/backports-20151120/compat' failed
make[4]: *** [/tmp/backports-20151120/compat] Error 2
Makefile:1524: recipe for target '_module_/tmp/backports-20151120' failed
make[3]: *** [_module_/tmp/backports-20151120] Error 2
Makefile.build:6: recipe for target 'modules' failed
make[2]: *** [modules] Error 2
Makefile.real:88: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
Makefile:40: recipe for target 'install' failed
make: *** [install] Error 2
**Does anyone know how to fix this?**
Please let me know if you need any other info.
Thanks in advance!
Update:
I installed the broadcom-sta-dkms package as you suggested. Unfortunately, you were right; this didn't work.
When I tried the wl driver, dmesg | grep -i wl returned [
12.459884] wl: loading out-of-tree module taints kernel.
[ 12.459890] wl: module license 'MIXED/Proprietary' taints kernel.
[ 12.468203] wl: module verification failed: signature and/or required key missing - tainting kernel
[ 12.487603] wl driver 6.30.223.271 (r587334) failed with code 1001
[ 12.487606] ERROR #wl_cfg80211_detach :
[ 12.487607] NULL ndev->ieee80211ptr, unable to deref wl
However, I'm afraid I am not sure what this means. For the other drivers, dmesg returned nothing.
Well, I'd suggest to be consistent. You have a Wi-Fi device and you know its PCI vendor ID (which stands before the colon) and device ID - 14e4:43ae. In your question you don't provide a complete excerpt from your lspci, so it's not clear whether your device is indeed identified as Broadcom. However, if we assume it's true, we can search for it.
Here is what WikiDevi page says:
802.11a/b/g/n/ac WLAN + Bluetooth 4.0 NGFF 2230 Mini Card
WI1 chip1: Broadcom BCM43162
Probable Linux driver unknown
PCI ID not yet observed in any mainline kernel / this list
So, as you might see, this page sheds light on such important things like chip naming and current observation of kernel code awareness of such PCI ID. The latter means that, according to their research, no one driver in the main kernel tree has such an ID in the corresponding PCI ID table by means of which the kernel makes a decision to probe a specific driver for a given device. Nothing known about the PCI ID.
But now we know for sure that this one is indeed a Broadcom device.
Looking at your excerpt from the script (which you are trying to make use of) baffles me a lot since it's for Qualcomm Atheros, not for Broadcom. It tries to grab QCA firmware from (possibly) untrusted repository and compile ath10k backported driver. So, at this point we know that the question merely about the compilation errors is unhelpful from the very beginning. But, of course, one may suppose that either Linux kernel headers package is not installed or the version of backported ath10k is not compatible with your current kernel. That's it.
So, it's clear that we shall look for Broadcom drivers (and, possibly, for Broadcom firmware) instead. From this perspective I can tell you that three types of drivers are available for Broadcom devices: b43 (mostly legacy), vendor-licensed broadcom-sta (wl) and in-tree brcm80211. The latter one is a common name for brcmsmac and brcmfmac.
Here are the authoritative pages with up-to-date info:
b43 - http://linuxwireless.org/en/users/Drivers/b43/
brcm80211 - https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
Also, a more or less descriptive page for the vendor-licensed wl:
https://wiki.debian.org/wl
I can't find your PCI ID on either of the pages. This indeed confirms that corresponding support has not been added yet. However, we can confirm this further by just trying the drivers on hands. It's obvious that in-kernel b43 and brcm80211 don't work for you, but it might be useful to take a look at dmesg - perhaps, brcm80211 is loaded but can't find FW.
If nothing useful is found, then it would be nice to try wl. This driver is distributed by means of broadcom-sta package (Debian, Ubuntu), and I can mention the corresponding description on Ubuntu website.
So, to try wl you need to make sure that you have proper Linux headers and then just install broadcom-sta-dkms package.
apt-get update
apt-get install linux-headers-$(uname -r)
apt-get install broadcom-sta-dkms
Hopefully, it will compile and install it. Then you should do a reboot and take a look at what happens with your Wi-Fi. Most likely, this won't help (since I suppose that your device is really not supported yet), but if it works, you will be able to use it. Even if you see for sure that your device doesn't work with wl, again, like in the case of brcm80211, it's worth taking a look at dmesg output. However, in example, seeking for a valid FW image (if dmesg complains about it) is a separate question and should be discussed accordingly.
Also, I can expand on this topic and mention that in certain mailing lists on the net some folks have already asked about plans to add support for this device. Here is one of the links. So, if neither brcm80211 nor wl (broadcom-sta-dkms) help you, you may consider sending an email to one of brcm80211 supporters. Their names and email addresses are listed on the page. There are Broadcom employees among them. If you ask them for a good piece of advice, you will also help other people.
UPDATE
So, you say that b43 (also b43_legacy) and brcm80211 keep silence in dmesg. This could mean that your PCI ID is not supported by these drivers.
What's for wl output, I can share my output for comparison:
wl: loading out-of-tree module taints kernel.
wl: module license 'MIXED/Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
wlan0: Broadcom BCM43a0 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)
This obviously means that your output minus this one gives some sort of silence again. However, it's too murky to say for sure whether your device is unsupported or there is some FW issue.
So, it seems like no options remain here.
However, you still may consider ndiswrapper solution. In two words, it's a special tool/driver which enables you to install a proper inf and sys files from the Windows driver (i.e. you should obtain it for your card somewhere, eg. extract from the CD or download from Broadcom webside) in such a way that the driver would operate in Linux as it was in Windows environment. This type of solution has its drawbacks and limitations. First of all, only Windows XP versions of wireless drivers are supported, so if you've got, say, a ZIP package from the vendor's website, you need to extract inf and sys files from the directory named after Windows XP (not Vista/7/10), and you need to pay attention to CPU architecture choice (32 bit / 64 bit). Here is an article from Debian which could fit Ubuntu as well. But this kind of solution overall may face some extra drawbacks and suddenly bad operation (it's a topic for a separate talk) and also in general it is considered as bad solution for missing driver. So, many people in such a situation just prefer to swap their unsupported card with some other one or just wait until the missing support is added to one of the native drivers. It's up to you.

Openocd reports "Failed with code (1)" for eclipse debugging a STM32F429 Discovery board

When I start a debugging session under eclipse (luna) for my STM32F429 Discovery board. I get the following error:
OpenOCD failed with code (1).
The information in the console pane is:
Open On-Chip Debugger 0.9.0-dev-00223-g1567cae (2015-01-12-13:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU ARM Eclipse
Info : clock speed 2000 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'
in procedure 'transport'
in procedure 'init'
The "board" file being referenced in the debug setup is: stm32f429discovery.cfg
I did have this working for another ST-Micro board and I could do a full debug session with no problems. Suddenly it just stopped being able to access the board and I get the same errors for it as I get with this board.
I was hoping to be able to use the purely open source s/w that runs on Linux to be able to work with these boards. I'm hoping that someone can get me out of this situation.
Thanks in advance.
Cheers!!
What you use the command and debugger?
try:
openocd -f interface/jlink.cfg -f target/stm32f429discovery.cfg

"setsockopt SO_SNDBUF failed in tcp_connect()"

I have a problem in my C client, where I implemented a client gsoap program to invoke a web service.
Everything works fine on a Windows PC, but when I publish my code on a linux-based POS device, I receive the following error:
"setsockopt SO_SNDBUF failed in tcp_connect()"
Where should I start to debug this error, what could be the cause?
the errornum returned is 2
The code section that generates the error : (in stdsoap2.c)
if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int))){
soap->errnum = soap_socket_errno(sk);
soap_set_sender_error(soap,
tcp_error(soap),
"setsockopt SO_SNDBUF failed in tcp_connect()",
SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
How big is the len argument? It's possible that the value works on Windows, but is rejected by linux for some reason. Take a look at the actual values being submitted and see if they look reasonable.
You can also try reducing this down to a very small program that just sets up a socket and tries to replicate the call to setsockopt() and see if it still fails with the SO_SNDBUF size the main program is trying to use.
well it turned out to be very simple one!!
i just had to build the c/c++ files using the binaries dedicated for linux....
gsoap(wsdl2h,soapcpp2)
windows build uses winsock and linux build uses standard sockets
and the sockets on the 2 systems are differentes!
thats why i was receiving the socket error.
hope this help others, getting this socket error msg..