HCI_UART on NRF52840, attaching the device on a Yocto based Linux SBC errors out saying "Can't init device hci0: Cannot assign requested address (99)" - bluetooth-lowenergy

I am trying to Interface a BLE module based on Nordic's nrf52840 to a Yocto based SBC, to which all the BlueZ related packages have been added.
I have flashed Zephyr's sample hci_uart program onto the module. The module seems to run perfectly on my Linux PC (BlueZ version 5.48), whereas on the SBC(BlueZ version 5.54) it fails to get inited. Here's the error that comes when I use
root#rb-imx6:~# hciconfig hci0 up
root#rb-imx6:~# Can't init device hci0: Cannot assign requested address (99)
Can anyone please help me out on this?
Thanks in advance.

The error of assigning an address is caused by missing Linux kernel configuration options:
CONFIG_CRYPTO_USER
CONFIG_CRYPTO_USER_API
CONFIG_CRYPTO_USER_API_AEAD
CONFIG_CRYPTO_USER_API_HASH
CONFIG_CRYPTO_AES
CONFIG_CRYPTO_CCM
CONFIG_CRYPTO_AEAD
CONFIG_CRYPTO_CMAC
This is likely to happen with a self-built Buildroot or Yocto Embedded Linux system. If you run into this error, you should enable above options and recompile the kernel.
See the BlueZ requirements here: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/README#n64
To see detailed debug output from BlueZ, run it with -d option:
bluetoothd -d

Related

mpirun error of oneAPI with Slurm (and PBS) in old cluster

Recently I installed Intel OneAPI including c compiler, FORTRAN compiler and mpi library and complied VASP with it.
Before presenting the question, there are some tricks I need to clarify during the installation of VASP:
GLIBC2.14: the cluster is an old machine with a glibc version of 2.12, where OneAPI needs a version of 2.14. So I compile the GLIBC2.14 and export the ld_path: export LD_LIBRARY_PATH="~/mysoft/glibc214/lib:$LD_LIBRARY_PATH"
ld 2.24: The ld version is 2.20 in the cluster, while a higher version is needed. So I installed binutils 2.24.
There is one master computer connected with 30 calculating nodes in the cluster. The calculation is executed with 3 ways:
When I do the calculation in the master, it's totally OK.
When I login the nodes manually with rsh command, the calculation in the logged node is also no problem.
But usually I submit the calculation script from the master (with slurm or pbs), and then do the calculation in the node. In that case, I met following error message:
[mpiexec#node3.alineos.net] poll_for_event (../../../../../src/pm/i_hydra/libhydra/demux/hydra_demux_poll.c:159): check exit codes error
[mpiexec#node3.alineos.net] HYD_dmx_poll_wait_for_proxy_event (../../../../../src/pm/i_hydra/libhydra/demux/hydra_demux_poll.c:212): poll for event error
[mpiexec#node3.alineos.net] HYD_bstrap_setup (../../../../../src/pm/i_hydra/libhydra/bstrap/src/intel/i_hydra_bstrap.c:1062): error waiting for event
[mpiexec#node3.alineos.net] HYD_print_bstrap_setup_error_message (../../../../../src/pm/i_hydra/mpiexec/intel/i_mpiexec.c:1015): error setting up the bootstrap proxies
[mpiexec#node3.alineos.net] Possible reasons:
[mpiexec#node3.alineos.net] 1. Host is unavailable. Please check that all hosts are available.
[mpiexec#node3.alineos.net] 2. Cannot launch hydra_bstrap_proxy or it crashed on one of the hosts. Make sure hydra_bstrap_proxy is available on all hosts and it has right permissions.
[mpiexec#node3.alineos.net] 3. Firewall refused connection. Check that enough ports are allowed in the firewall and specify them with the I_MPI_PORT_RANGE variable.
[mpiexec#node3.alineos.net] 4. pbs bootstrap cannot launch processes on remote host. You may try using -bootstrap option to select alternative launcher.
I only met this error with oneAPI compiled codes but Intel® Parallel Studio XE compiled. Do you have any idea of this error? Your response will be highly appreciated.
Best,
Léon
Could it be a permissions error with the Slurm agent not having the correct permissions or library path?

Force terminate WIA or TWAIN driver (scanner)

I'm having a pretty annoying issue. When I try to silent install a program, that program depends on the WIA or TWAIN driver (for scanners) NOT being "in use". The problem is that driver can be "in use" even after the scanner is unplugged from the computer (if it was plugged in before, the driver is used and doesn't stop being in use after unplugging)
My question is, to your knowledge, what controls this WIA / TWAIN driver? Is it a service I can force close or a process?
I have found these 2 services for WIA :
stisvc
WiaRpc
but nothing regarding TWAIN.
My goal would be to add that force close in the installation script so it makes SURE that WIA or TWAIN cannot be in use whatsoever before installing.
I found the solution, might be useful for any other people having problems with these drivers. First download ListDlls by SysInternals : https://learn.microsoft.com/en-us/sysinternals/downloads/listdlls
Then with PowerShell:
Stop-Service -Name stisvc -Force
[string]$twain_utilise = C:\TEMP\Listdlls.exe -d TwainDSM.dll | select-string "pid"
if ($twain_utilise) {
$processus = ($twain_utilise -Split(": "))[1]
}
Stop-Process -id $processus -Force
Explanation :
-Stop the service STISVC which is in charge of WIA (Windows Image Acquisition (WIA))
-Run ListDlls.exe on TWAINDSM.DLL to find out what is using the dll by selecting the PID of found program.
-IF the command was successful (in other terms, if the PID was found, meaning a program IS using that DLL), split the content so you can isolate the PID number only.
-Stop the process with it's PID so TWAIN isn't in use anymore
You now have stopped any use of WIA or TWAIN and can proceed to install drivers or software that require these drivers not to be in use! Cheers.

Can't Flash Code to Particle Photon

I have a Particle Photon which I'm trying to setup. I've tried flashing code both from the web IDE, and locally and it always times out. The device is connecting as it can be seen in these pictures:
The web IDE does not give me much information. It only says "Request Timed Out". This is what I get when I try to flash an .ino code
MacBook-Pro:Desktop User$ particle flash ABCDEFGH123456789 sketch_jun09a/
Including:
sketch_jun09a/sketch_jun09a.ino
attempting to flash firmware to your device ABCDEFGH123456789
Flash device failed.
Request Timed Out
And when I try to flash a firmware.bin file this is what I get:
MacBook-Pro:Downloads Usesr$ particle flash --usb firmware.bin
Found DFU device 2b04:d006
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D firmware.bin
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash "
Downloading to address = 0x080a0000, size = 5224
Download [=========================] 100% 5224 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status
Error writing firmware...dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: Error during download get_status
I've seen online that the firmware.bin file seems to be compiled for the Particle Core, and not the Photon, so the device does not allow the code to be flashed. How should I compile the code for it to work? Is there any other solution to this problem? Thank you in advance.
You won't be able to flash a Core firmware to a Photon (they have different architecture and firmware layout). To compile the code for photon you can also use the CLI:
$ particle compile photon sketch_jun09a/
the resulting binary can be flashed using the CLI the same way you did.
To figure out the failed over the air flash I would recommend contacting the support.

Opencl clGetPlatformIDs error -1001

I am trying to run some OpenCL programs.
I have a NVidia graphics card (GeForce 6600).
But , when I execute my program and I get a error :
Unable to get platforms -1001
My OS is ArchLinux and I already install the following packages (
from pacman ):
1. libcl
2. opencl-headers
3. opencl-nvidia-304xx
4. lib32-opencl-nvidia-304xx
How to fix this problem in my environment?
or what necessary packages need to install?
thanks.
OpenCL-error -1001 "CL_PLATFORM_NOT_FOUND_KHR" doesn't necessarily mean you don't have any OpenCL-capable device. This means, that cl_khr_icd-extention have a trouble to load the proper vendor driver.
Try to run your OpenCL-program(s) as root. Or try to use clIcdGetPlatformIDsKHR.
If you not running X11, you need to create device files manually or by script

Hostapd start error

make wthis this manual
http://wireless.kernel.org/en/users/Documentation/hostapd
with this config file
interface=wlan2
bridge=br0
driver=nl80211
ssid=SupaAP
country_code=RU
hw_mode=g
channel=5
preamble=1
macaddr_acl=0
auth_algs=1
logger_syslog=-1
logger_syslog_level=3
logger_stdout=-1
logger_stdout_level=2
ignore_broadcast_ssid=0
ieee80211n=1
ht_capab=[SHORT-GI-20][RX-STBC1]
wmm_enabled=1
and i have error
oot#Cubian:/home/cubie/wif/hostapd-2.1/hostapd# ./hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 16: unknown configuration item 'ieee80211n'
Line 17: unknown configuration item 'ht_capab'
2 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
Failed to initialize interfac
in old version i dont have thsi error
It appears that the problem is that hostapd 2.1 is now treating an error it had differently.
This is reproducible on Ubuntu desktop versions, as the resource (WLAN) is busy.
If one turns off the programs that are accessing the resource, hostapd has a chance to grab it and work.
In Ubuntu desktop 14.04 beta, a solution is to turn off the programs that are using the wlan in question.
This worked for me:
sudo nmcli nm wifi off
sudo rfkill unblock wlan
then hostapd can start normally from command line. Of course, if you want hostapd to start on boot you must insure that the network manager is not grabbing the resource ahead of time.
SOLVED
in compile conf i uncomment string
CONFIG_IEEE80211N=y
I have found this link explaining the cause of the error and how to solve it.
https://bugs.archlinux.org/task/20269
Also I have found this other link http://blog.mirjamali.com/en/IT/Linux/hostapd which I followed and it is working with me check the configuration part.
My OS is ubuntu 12.4
start your hostapd with
hostapd -dd /etc/hostapd/hostapd.conf
you will get more information for diagnostics. In which old version you did not get the error? Did you update hostapd? Or changed your wifi adapter? which distri you are using?
http://hostap.epitest.fi/cgit/hostap/plain/hostapd/hostapd.conf
there is written how the ieee80211n settings are. for me i cant see an error.
if you remove the both lines, the ap is starting correctly?

Resources