Arduino connection via /dev/ttyACM0 not working - ubuntu-18.04

I have troubles to connect to arduino UNO via Arduino IDE on Ubuntu
Of course ports are greyed out, but I set it up manually.
When I try to upload I get following information:
java.lang.NullPointerException thrown while loading
gnu.io.RXTXCommDriver processing.app.SerialNotFoundException: Serial
port '/dev/ttyACM0' not found. Did you select the right one from the
Tools > Serial Port menu?
Installed packages:
$ apt list --installed |grep arduino
arduino/bionic,bionic,now 2:1.0.5+dfsg2-4.1 all [installed]
arduino-core/bionic,bionic,now 2:1.0.5+dfsg2-4.1 all [installed]
arduino-mk/bionic,bionic,now 1.5.2-1 all [installed]
$
I am member of dialout group:
$ cat /etc/group |grep marcin
uucp:x:10:marcin
dialout:x:20:marcin
fax:x:21:marcin
audio:x:29:pulse,marcin,timidity
dip:x:30:marcin,marcin
video:x:44:marcin
plugdev:x:46:marcin
marcin:x:1001:
Port /dev/ttyACM0 is the proper one:
$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 paź 12 20:54 /dev/ttyACM0
$
dmesg output:
[ 1033.897893] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[ 1034.051751] usb 1-1: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[ 1034.051768] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 1034.051780] usb 1-1: Manufacturer: Arduino (www.arduino.cc)
[ 1034.051789] usb 1-1: SerialNumber: 9573xxxxxxxxxxxx
[ 1034.112081] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[ 1034.114359] usbcore: registered new interface driver cdc_acm
[ 1034.114363] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Arduino preferences files related to port:
$ cat .arduino/preferences.txt |grep serial
serial.databits=8
serial.debug_rate=9600
serial.parity=N
serial.port=/dev/ttyACM0
serial.stopbits=1
$
USB devices:
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 058f:5608 Alcor Micro Corp.
Bus 001 Device 002: ID 258a:000c
Bus 001 Device 004: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$
Computer has been restarted, USB cable was pluged in and out several times with IDE turned on and off, No more ideas on how to move forward.
Any help will be appreciated. Thanks.

I followed the bug pointed by NPE and it solved the issue.
I installed librxtx-java package from bionic-proposed repository
$ sudo apt-get install librxtx-java/bionic-proposed
Now connection works smoothly. Thank you!

Related

NIC is unavailable in DPDK application

I'm studying DPDK and trying to create a simple application, however it can't see a NIC bound to DPDK.
Here is a list of network devices I have on my machine
$ dpdk-devbind.py --status-dev net
Network devices using kernel driver
===================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
I disable my ethernet NIC (it can't be bound to DPDK while it is active) and bind it to vfio-pci driver successfully
$ ip link set enp1s0 down
$ dpdk-devbind.py -b vfio-pci enp1s0
Now dpdk-devbind.py shows that the NIC is using DPDK-compatible driver
$ dpdk-devbind.py --status-dev net
Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' drv=vfio-pci unused=r8169
Network devices using kernel driver
===================================
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
However when I run any example DPDK application it says that there are no available NIC ports. For instance I wrote a simple application
int main(int argc, char *argv[])
{
int ret;
int total_ports, avail_ports;
ret = rte_eal_init(argc, argv);
if( ret < 0 )
rte_exit(EXIT_FAILURE, "EAL initialization failed\n");
total_ports = rte_eth_dev_count_total();
avail_ports = rte_eth_dev_count_avail();
printf("ETH PORTS %d %d\n", total_ports, avail_ports);
rte_eal_cleanup();
return 0;
}
and both rte_eth_dev_count_total() and rte_eth_dev_count_avail() return 0.
What am I doing wrong?
The main reason why DPDK ports are not identified in your environment is because the NIC in use is not having a supported vendor Poll Mode Driver. Please refer to list of supported NIC from various vendor Realtek is not among them.
Work around: you can use PCAP PMD to solve the problem. Please follow the steps for your environment as
ensure your ethernet port is linked to kernel driver r8169
isntall libpacp-dev for your enviorment (linux/bsd)
rebuild dpdk with PCAP support.
start your application with following args --no-pci --vdev=net_pcap0,iface=enp1s0
This will use libpcap PMD as wrapper for RX and TX over non supported NIC

Getting "No Wifi adaptor found" for ubuntu 18.04 in DELL precision

I use DELL Precision 3541.
After rebooting my laptop, I am getting "No Wifi adaptor found". So I tried few solutions mentioned in stackoverflow. But when I hit sudo lshw -C network
I am getting this in response
description: Network controller
product: Wireless-AC 9560 [Jefferson Peak]
vendor: Intel Corporation
physical id: 14.3
bus info: pci#0000:00:14.3
version: 10
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list
configuration: driver=iwlwifi latency=0
resources: irq:16 memory:ed43c000-ed43ffff
*-network:1
description: Ethernet interface
product: Ethernet Connection (7) I219-V
vendor: Intel Corporation
physical id: 1f.6
bus info: pci#0000:00:1f.6
logical name: eno2
version: 10
serial: 34:48:ed:03:b3:22
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.5-4 latency=0 link=no multicast=yes port=twisted pair
resources: irq:172 memory:ed400000-ed41ffff
There is no logical name for my wifi adaptor.
Is there any way I can enable the wifi adaptor on my laptop?
I tried something random. Dont know how it worked for me. Just followed the steps.
1.Restarted my Laptop.
2.Entered BOIS setup (F12).
3.Then inside the wireless section, I completely disabled WLAN.
4.When it booted up successfully, Restarted Laptop again.
5.Entered BOIS setup and enabled the WLAN.
Finally, when the laptop turned on, everything was working fine again.
In my case I installed ubuntu 20.04 and wifi was not working, message was same as "No wifi adaptor found".
I had onboard wifi adaptor.
Using command sudo lshw -C network, I got
*-network
description: Wireless interface
product: Wi-Fi 6 AX200
vendor: Intel Corporation
I knew that my wifi adaptor is of Intel® and now I found that Wi-Fi 6 AX200 160MHz is the actual adaptor.
After doing hours of googling, I went on intel official site and found this link Linux* Support for Intel® Wireless Adapters
I found that my adaptor was listed there under Intel® Wi-Fi 6 AX200 160MHz
I downloaded iwlwifi-cc-46.3cfab8da.0.tgz and extracted it under the directory /lib/firmware as mentioned on intel site.
wooooooooooooo, ubuntu was able to detect the adaptor and my wifi connections were listed under wifi settings.
You may need to restart the system, though in my case it worked as soon as I extracted the files in /lib/firmware.

Check USB device ID and connected port from C application

I need to be able to identify a plugged USB device (USB3 and/or USB2) and which port is connected to in the hub from a C program. I'm working on a embedded Linux system Yocto based.
I'm able to get this info from the command line with lsusb. E.g. I've got connected two USB cameras, one USB3 and the other USB2 and if I run lsusb -t I can see the port connections tree:
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 4: Dev 6, If 0, Class=Miscellaneous Device, Driver=, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 480M
With this I know easily that the USB3 camera is connected to Port 4 and the USB2 one to Port 3 (using a 4 ports HUB). If I run only lsusb got the IDs and names:
Bus 002 Device 006: ID 20f7:3001 USB3 Camera with CMOS sensor [MQ]
Bus 001 Device 003: ID 0403:de37 Future Technology Devices International, Ltd
Bus 001 Device 002: ID 04b4:650a Cypress Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 04b4:6508 Cypress Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
How could I easily scan the hub ports and see what device (name or ID) is connected where (hub port number) from a C application?
Apologise if this already answer somewhere but I couldn't find a specific answer.
Thanks in advance.
As pointed the answer is libusb, and I found the complete answer with an example in this question.
Also the API for libusb is defined here.

JTag Debugging with Eclipse Mars CDT : "Program file does not exist"

I have successfully compiled an ARM embedded project, next files has been created:
MyProject.elf
MyProject.bin
MyProject.hex
MyProject.map
MyProjectmd5.bin
Then I am going to Run -> Debug Configurations -> GDB SEGGER J-Link Debugging -> New -> Debug and I get the error:
Program file does not exist
The GCC Compiler for ARM used: https://launchpad.net/gcc-arm-embedded
ARM Eclipse plugins used: http://gnuarmeclipse.livius.net/blog/
and that's what I see in the console:
23:25:36 **** Build of configuration Release for project MyProject ****
make all
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "MyProject.elf"
text data bss dec hex filename
40120 252 2252 42624 a680 MyProject.elf
Finished building: MyProject.siz
23:25:36 Build Finished (took 112ms)
It seems that there is a problem running JLinkGDBServer
$ JLinkGDBServer
SEGGER J-Link GDB Server V4.98e Command Line Version
JLinkARM.dll V4.98e (DLL compiled May 5 2015 11:59:38)
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: unspecified
Target interface: JTAG
Target interface speed: 1000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled May 4 2015 13:48:48
Hardware: V1.00
S/N: 681968347
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
C/C++ Application in Main TAB was missing.
OK using Debug/MyProject.elf

Porting eCos to i386

I am trying to port eCos on an i386 PC.
I have downloaded prebuilt redboot.bin from
http://ecos.sourceware.org/ecos/boards/redbootbins/x86pc/
I boot it onto usb disk, using
dd conv=sync if/redboot.bin of=/dev/sdb1
After booting target from usb, I get "IA2!" string on the target monitor always, and on serial port on 38400 8n1 configurations, I receive nothing.
I tried using i386-elf-gdb, but it is not able to connect to the target and starts printing "Ignoring error packet, Continuing..."
I also tried to build redboot using configtool for i386, but it is only able to build library, when I try Tests, It gives ERROR: multiple definition of cyg_start()
I am very new to eCos, and I don't know what I am doing wrong!!.
Ok, I figured out how to boot Redboot on a target i386 pc with RealteK RTL8139 ehternet card.
install grub on usb stick,
mkdir /mnt/USB && mount /dev/sdx1 /mnt/USB
grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx
Build Redboot using ecosconfig, make sure the number of pci bus are less than 8 or more, if more, then need to increase the pci bus range from from 8 inside pci.h, I had my realtek ethernet card on bus 10 dev 10, I had to increase the bus to 11, so that redboot finds realtek card on bootup.
ecosconfig new pc redboot
configtool ecos.ecc
add common ethernet support
Build Library
copy redboot.elf on usb.
on grub startup menu,
insmod multiboot
multiboot /redboot.elf
boot
Thats it, redboot will use BOOTP and provide IP Address, then I can test redboot commands like ip_address, reset, ping, version etc.

Resources