Device Managers on Machines with external 10GigE devices causing problems - redhawksdr

The issue I am having is when I go to start a device manager on a remote PC and I have an external hardware device with 10GigE ports connected the registerDevice message from the device manager registers the IP address of the 10GigE interface used by the external device connected to the device manager PC instead of the device manager machines actual IP address.
Network Setup:
PC1
Domain Manager:192.168.5.10
Device Manager A(GPP):192.168.5.10 (on same machine as the domain manager)
PC2
Device Manager B(GPP):192.168.5.11
Device Interface: 192.168.100.10 (connected to external hardware)
If I run my scenario without the external device connected to PC2, the device manager on that machine registers with IP address: 192.168.5.11. If I connect the external hardware to PC2 and the 10GigE interface comes online, the device manager registers with IP address: 192.168.100.10 and the entire REDHAWK domain hangs.
I verified this issue by going through wireshark logs on both PC1 and PC2. We have not had this problem when connecting UHD devices other than the UHD devices with 10GigE ports. It is important to note that no devices or device managers for them are actually being used at this point. The devices are just powered on and a node with only the GPP is started. In the UHD and external hardware case, both 10GigE ports are custom and implement a limited 10GigE interface. When connected to another PC with 10GigE instead of a device with a limited 10GigE implementation, the device manager works.
If I connect the 10GigE device after the node is active, the FE 2.0 devices work perfectly fine. This scenario, however, will not work for us as physically walking over and powering on the device is not valid for our use case. In addition, running with the devices on a domain started on the same computer does not exhibit these issues. This problem only occurs when the domain is on a remote PC.
We are currently working with the following REDHAWK versions and it has the same problem on both.
CentOS 6.6 with REDHAWK 2.0.3 and OmniORB 4.1
Fedora 24 with REDHAWK 2.0.3 and OmniORB 4.2
Has anyone else had this problem and is there anything I can do about it?

Lets use docker to run through a thorough example. You'll need to bring up 3 terminals and have docker installed but we can do this all on one host. I'll refer to the 3 terminals as the "Domain", "Sandbox", and "Host system".
In the Domain Terminal, spin up a fresh redhawk 2.0.2 instance:
docker run -it --name=domain axios/redhawk:2.0.2 bash -l
In the Sandbox Terminal, spin up another redhawk 2.0.2 instance:
docker run -it --name=sandbox axios/redhawk:2.0.2 bash -l
If you aren't familiar with docker, these two docker instances have unique filesystems, memory, and networking. Do an ifconfig to check the IP addresses of each and note them down. Note that they are on the same subnet and can ping one another.
We can now emulate your 10GigE ports by creating two new networks which cannot reach each other. On the Host Terminal use docker to create two separate fake networks and assign them to your container instances.
docker network create -o "com.docker.network.bridge.host_binding_ipv4"="1.1.1.1" bad_net_1
docker network create -o "com.docker.network.bridge.host_binding_ipv4"="2.2.2.2" bad_net_2
docker network connect bad_net_1 domain
docker network connect bad_net_2 sandbox
Back in the Domain and Sandbox terminals rerun ifconfig, notice you now have an eth0 and eth1 interface where eth1 on the Domain and Sandbox instance are on unique subnets and cannot communicate.
Your IP addresses may be different but for me I have:
Domain:
eth0: 172.17.0.2
eth1: 172.19.0.2
Sandbox:
eth0: 172.17.0.3
eth1: 172.20.0.2
I'll now configure the Domain to be the omniNames host, set omniORB connection timeout so we don't hang on corba calls, and INCORRECTLY configure the endPoint so that the WRONG IP address is advertised.
On the Domain machine:
sudo tee /etc/omniORB.cfg << EOF
InitRef = NameService=corbaname::172.17.0.2:2809
supportBootstrapAgent = 1
InitRef = EventService=corbaloc::172.17.0.2:11169/omniEvents
endPoint = giop:tcp:172.19.0.2:
serverCallTimeOutPeriod = 5000
clientConnectTimeOutPeriod = 5000
clientCallTimeOutPeriod = 5000
EOF
On the Sandbox machine:
sudo tee /etc/omniORB.cfg << EOF
InitRef = NameService=corbaname::172.17.0.2:2809
supportBootstrapAgent = 1
InitRef = EventService=corbaloc::172.17.0.2:11169/omniEvents
endPoint = giop:tcp:172.20.0.2:
serverCallTimeOutPeriod = 5000
clientConnectTimeOutPeriod = 5000
clientCallTimeOutPeriod = 5000
EOF
On the Domain machine start omniNames and events via cleanomni which will also clear out any stale state:
cleanomni
On the sandbox machine run nameclt list to view the omniORB objects. Note that it does not work since the endPoint address advertised for the domain is wrong. If we up the logging in /etc/omniORB.cfg via traceLevel=40 we can even see in the message the incorrect IP address.
omniORB: inputMessage: from giop:tcp:172.17.0.2:2809 236 bytes
omniORB:
4749 4f50 0100 0101 e000 0000 0000 0000 GIOP............
0400 0000 0000 0000 0000 0000 2a00 0000 ............*...
4944 4c3a 6f6d 672e 6f72 672f 436f 734e IDL:omg.org/CosN
616d 696e 672f 4269 6e64 696e 6749 7465 aming/BindingIte
7261 746f 723a 312e 3000 0000 0100 0000 rator:1.0.......
0000 0000 9400 0000 0101 0200 0b00 0000 ................
3137 322e 3139 2e30 2e32 0000 23ae 0000 172.19.0.2..#...
0e00 0000 ff00 bb05 0a58 0100 003c 0000 .........X...<..
0002 0000 0400 0000 0000 0000 0800 0000 ................
0100 0000 0054 5441 0100 0000 1c00 0000 .....TTA........
0100 0000 0100 0100 0100 0000 0100 0105 ................
0901 0100 0100 0000 0901 0100 0300 0000 ................
1600 0000 0100 0000 0b00 0000 3137 322e ............172.
3137 2e30 2e32 0000 f90a 0000 0354 5441 17.0.2.......TTA
0800 0000 bb05 0a58 0100 003c .......X...<
On the domain terminal, using vim or emacs fix the endPoint in /etc/omniORB.cfg and run cleanomni to clear out any old references and restart the omni sevices. From the sandbox terminal you can now properly run nameclt list.
On the domain terminal start up a domain using nodeBooter -D and from the sandbox terminal connect to the domain via python and confirm you can interact with it as expected.
>>> from ossie.utils import redhawk
>>> dom = redhawk.attach('REDHAWK_DEV')
>>> dom.name
'REDHAWK_DEV'
>>> fs = dom.fileManager
>>> fs.list('.')
Note that so far, we have only been making calls from the Sandbox to the Domain so only the advertised endPoint of the Domain Machine has mattered. Calls like "start" and "stop" are made from you down to a component but calls like pushPacket are made from the component out to you. We can confirm this by connecting a SigGen on the Domain Machine to a HardLimit on the Sandbox machine. Remember, right now the domain machine is properly configured and the sandbox machine is not.
On the Domain machine, stop the domain and run the following to install a waveform and launch the domain with a GPP:
sudo yum install -y rh.basic_components_demo
nodeBooter -D -d /var/redhawk/sdr/dev/nodes/DevMgr_12ef887a9000/DeviceManager.dcd.xml
Now back in the sandbox machine in python:
from ossie.utils import redhawk, sb
import time
dom = redhawk.attach('REDHAWK_DEV')
app = dom.createApplication('/waveforms/rh/basic_components_demo/basic_components_demo.sad.xml')
siggen = app.comps[0]
siggen.start()
hardlimit = sb.launch('rh.HardLimit')
sink = sb.DataSink()
hardlimit.connect(sink)
siggen.connect(hardlimit)
sb.start()
time.sleep(1)
sink.getData()
You should get no data in the sink since the wrong endPoint is advertised by the sandbox machine. Now exit out of python fix the endPoint on the Sandbox instance and rerun this experiment. This time you get data since both endPoints are properly configured.
Lastly, what happens if you do not set an endPoint at all? (As I imagine was your case) From the omniORB sample configuration file:
By default, no endPoint configuration is defined. In this case the
ORB will create just 1 tcp endpoint as if the line:
endPoint = giop:tcp::
is specified in the configuration file
and
The host and port parameter are optional. If either or
both are missing, the ORB fills in the blank. For example,
"giop:tcp::" will cause the ORB to pick an arbitrary tcp port
as the endpoint and it will pick one IP address of the host
as the host address.
So you may get very strange behavior. Hopefully this example has helped and is easy enough for everyone to run through / reproduce.
Now that we are done we can clean up our docker instances and docker networks with:
docker rm -f domain sandbox
docker network rm bad_net_1 bad_net_2

Related

How can I get the port of my Rflink (Arduino Mega) to show in /dev on my Raspberry pi 3?

I bought a RFlink Gateway from Nodo-shop.nl, the the RFLink 433.42 Somfy RTS version, to use with Domoticz on a RPI. I had Nodo to solder the components of my Rflink, so there should not be any problem on this end :)
I connected it to my MacbookAir, and followed the instructions on Domoticz wiki to upload the firmware into the RFlink. It apparently uploaded the firmware successfully.
Then I updated and upgraded my RPI (Linux raspberrypi 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux) and hooked it up to my Raspberry Pi 3 .
I tried to identify the port with Dmesg. If the Arduino Mega is detected, I cannot see the ttyAMCO or ttyUSB everyone is referring to in various posts.
Here is the output of the dmesg command:
[3902580.423329] usb 1-1.1.2: new full-speed USB device number 9 using dwc_otg [3902580.568650] usb 1-1.1.2: New USB device found, idVendor=2341, idProduct=0042, bcdDevice= 0.01 [3902580.568671] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=220 [3902580.568685] usb 1-1.1.2: Manufacturer: Arduino (www.arduino.cc) [3902580.568699] usb 1-1.1.2: SerialNumber: 55037313237351714260
I also tried to look for the port using this command ls /dev | grep tty*. I can only see these ports : ttyXX, ttyAMA0 and ttyprintk. But no sign of the port of my RFlink Gateway.
When I use this command lsusb, it shows it recognizes the Arduino:
Bus 001 Device 009: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM).
I read tons of posts on the internet but I did not find any answer to my problem.
I even bought a power supply for my Arduino Mega as some wrote that it may not get enough power from the RPI's USB. But I still have the same problem...
What I'm not doing right ? Or what am I not looking at ?
Thank you for your help
Sorry, bit late but it might be useful to someone else...
It might well be the /dev/ttyAMA0 you found - it depends what else you've got on there.
listing by id should identify it definitively though:
$ ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 root root 13 Mar 18 2021 usb-0658_0200_12345678-9012-3456-7890-123456789012-if00 -> ../../ttyACM1
lrwxrwxrwx 1 root root 13 Mar 18 2021 usb-Arduino__www.arduino.cc__0042_55639313533351509150-if00 -> ../../ttyACM0
So, in my case it's on /dev/ttyACM0.
If you've got multiple USB serial adapters, reboot the pi with them all plugged in to get the default mapping (I've seen hotplugged AMA0 and AMA1 swap after a reboot).

CentOS 7 USB. Connect to Wi-Fi using CLI only

I just installed CentOS 7 [Kernel 3.10.0-514] on my USB stick.
Operating system works fine but I had some problems with my Broadcom 43227 wireless card.
I downloaded driver, patched it, changed code a bit according to the instruction here: https://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom and after many attempts it finally compilled and after loading the driver module into kernel led turned on.
Now I need to connect to my Wi-Fi.
What am I trying to do:
Get wireless interface name using iw dev:
phy#0
Interface wlp2s0
Scan to find WiFi Network using iw wlp2s0 scan | grep SSID
SSID: MyNetworkName
Generate a WPA/WPA2 configuration file using wpa_passphrase MyNetworkName >> /etc/wpa_supplicant.conf
MyNetworkPassword
Connect to WPA/WPA2 WiFi network using wpa_supplicant -B -D wext -i wlp2s0 -c /etc/wpa_supplicant.conf
Successfylly initialized wpa_supplicant
[and in some cases after few minutes]
ERROR #wl_cfg80211_scan: WLC_SCAN error (-22)
Get an IP using dhclient using dhclient wlp2s0
But nohing happens
Ping command : Name or sarvice not known
If I run wpa_supplicant without -B I get some repeating errors:
Device or resource busy
wlp2s0: Failed to initiate AP scan
wlp2s0: Trying to associate with [MAC] (SSID='MyNetName' freq=2462 MHz)
Operation not supported
wlp2s0: Association request to the driver failed
....
if I add -D nl80211 to wpa_supplicant call I get same errors without "Device or resource busy"
What I am doing wrong?

Bluetooth LE on Raspbian does not bond with nRF

I have an Rpi3 and I want to bond it with nRF which is connected to my laptop via UART. This nRF-laptop connection shows me whether Rpi3 is connected and/or paired with nRF. I am able to connect to the nRF device by running:
gatttool -t random -b XX:XX:XX:XX:XX:XX -I
I found that to be able to pair it, all I need to do is run the following command after I connected using gattool:
sec-level medium
However, nRF device only showed "Connected".
Then I tried using bluetoothctl command. I made sure the power is on, agent is on, it's discoverable and etc. After I ran the command pair XX:XX:XX:XX:XX:XX, it said it was successful. This was also confirmed after running info XX:XX:XX:XX:XX:XX. Yet nRF device did not react to the pairing. If I connect to nRF device through my phone using "nRF Connect" app, then nRF shows that my phone is paired.
I am running:
Linux 4.9.13-v7+ #974 SMP Wed Mar 1 20:09:48 GMT 2017 armv7l GNU/Linux
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
Bluez-5.44
I followed tutorials from adafruit and stackoverflow. I read that for Bluez-5.44 I do not need to run bluetooth in the experimental mode.
What am I missing? I would appreciate any help.
To any lost souls who might have also been stuck in this situation, here is how I solved it (you need to run sudo for the following commands):
$ service bluetooth stop
$ /etc/init.d/bluetooth start
If the nRF device has been paired once and then restarted, that means the pairing key is still on Pi's side which needs to be removed and can be done by:
$ bluetoothctl
$ remove XX:XX:XX:XX:XX:XX
$ exit
After this you need to start bluetooth device:
$ hciconfig hci0 up

Debian: cannot create rfcomm0

On Debian Jessie 8.2:
I'm trying to create the following device: /dev/rfcomm0 in order to connect my arduino via bluetooth module HC-05, but no success.
Here are the steps I'm following:
1) I guess my HC-05 called FOO is recognised and properly configured, because
hcitool scan
reports
98:D3:31:xx:xx:xx FOO
xx are just a mask I use here for privacy.
2) I added the file /etc/bluetooth/rfcomm.conf
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 98:D3:31:xx:xx:xx;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "FOO";
}
3) I restarted bluetooth service
sudo /etc/init.d/bluetooth restart
response is:
[ ok ] Restarting bluetooth (via systemctl): bluetooth.service.
Nevertheless device rfcomm0 is not created.
I'm following the instructions here:
Bluetooth serial communication with HC-05
I did this operation months ago on another Linux system (it was ubuntu) and I can remember
evertything went well: the port was created. Probably I'm missing some important step!
Thanks a lot,
Valerio
UPDATE:
this command
sdptool records 98:D3:31:xx:xx:xx
reports
Service Name: Dev B
Service RecHandle: 0x10000
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
I think this confirms that the channel in rfcomm.conf is 1
Ok , thanks to Kaylum this is solved!
The manual binding create the device rfcomm0
sudo rfcomm bind 0 98:D3:31:xx:xx:xx 1
Then, in order to make Processing write/read on the created port,
I needed to run Processing as sudoer, otherwise Processing says that the port exists but is busy. As sudoer, I can confirm that the port correctly sends data back and forth between Arduino and Processing!

How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)?

I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303.
I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
$ sudo minicom --device /dev/ttyUSB0
minicom: cannot open /dev/ttyUSB0: No such file or directory
$ sudo lsusb -v
Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
bLength 18
bDescriptorType 1
$ tail /var/log/syslog #then removed and attached the device.
Mar 13 23:31:49 ubuntu kernel: [807996.786805] usb 2-1: pl2303 converter now attached to ttyUSB0
Mar 13 23:34:44 ubuntu kernel: [808172.155129] usb 2-1: USB disconnect, address 7
Mar 13 23:34:44 ubuntu kernel: [808172.156321] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
Mar 13 23:34:44 ubuntu kernel: [808172.156374] pl2303 2-1:1.0: device disconnected
Mar 13 23:34:52 ubuntu kernel: [808179.497856] usb 2-1: new full speed USB device using uhci_hcd and address 8
Mar 13 23:34:52 ubuntu kernel: [808179.785845] pl2303 2-1:1.0: pl2303 converter detected
Mar 13 23:34:52 ubuntu kernel: [808179.872309] usb 2-1: pl2303 converter now attached to ttyUSB0
First check with dmesg | grep tty if system recognize your adapter.
Then try to run minicom with sudo minicom -s, go to "Serial port setup" and change the first line to /dev/ttyUSB0.
Don't forget to save config as default with "Save setup as dfl". It works for me on Ubuntu 11.04 on VirtualBox.
You will need to set the permissions every time you plug the converter in.
I use PuTTY to connect. In order to do so, I have created a little Bash script to sort out the permissions and launch PuTTY:
#!/bin/bash
sudo chmod 666 /dev/ttyUSB0
putty
P.S. I would never recommend that permissions are set to 777.
Long time reader, first time helper ;)
I'm going through the same hellish experience here with a Prolific USB <> Serial adapter and so far Linux is the easiest to get it to work.
On CentOS, I didn't need to install any drivers etc.. That said,
dmesg | grep -i tty or dmesg | grep -i usb showed me /dev/ttyUSB0.
screen ttyUSB0 9600 didn't do the trick for me like it did in OSX
minicom is new to me but it was complaining about lack of /dev/modem
However, this helped: https://www.centos.org/forums/viewtopic.php?t=21271
So install minicom (yum install minicom) then enter its settings (minicom -s).
Then select Serial Port Setup and change the Serial Device (Option A) to /dev/ttyUSB0, or whatever your device file is as it slightly differs per distro.
Then change the Bps (Option E) to 9600 and the rest should be default (8N1 Y N)
Save as default, then simply minicom and Bob's your uncle.
HTH.
The serial port communication programs moserial or gtkterm provide an easy way to check connectivity and modify /dev/ttyUSB0 (or /dev/ttyUSB1!) settings. Even though there maybe only a single USB to RS232 adapter, the n designation /dev/ttyUSBn can and does change periodically! Both moserial and gtkterm will show what port designation is relevant in their respective pull down menus when selecting an appropriate port to use.
Check out help.ubuntu.com/community/Minicom for details on minicom.
I had fix this with adduser *username* dialout. I never had this error again, even though previously the only way to get it to work was to reboot the PC or unplug and replug the usb to serial adapter.
I get get the same minicom error, "cannot open /dev/ttyUSB0: No such file or directory"
Three notes:
I get the error when the device attached to the serial port end of my Prolific Technology PL2303 USB/Serial adapter is turned off. After turning on the device (an embedded controller running Linux) minicom connected fine.
I have to run as super user (i.e. sudo minicom)
Sometimes I have to unplug and plug back in the USB-to-serial adapter to get minicom to connect to it.
I am running Ubuntu 10.04 LTS (Lucid Lynx) under VMware (running on Windows 7). In this situation, make sure the device is attached to VM operating system by right clicking on the USB/Serial USB icon in the lower right of the VMware window and select Connect (Disconnect from Host).
Remember to press Ctrl + A to get minicom's prompt, and type X to exit the program. Just exiting the terminal session running minicom will leave the process running.
I had the exact same problem, and it was fixed by doing a chmod 777 /dev/ttyUSB0. I never had this error again, even though previously the only way to get it to work was to reboot the VM or unplug and replug the USB-to-serial adapter. I am running Ubuntu 10.04 (Lucid Lynx) VM on OS X.
I suggest that newbies connect a PL2303 to Ubuntu, chmod 777 /dev/ttyUSB0 (file-permissions) and connect to a CuteCom serial terminal. The CuteCom UI is simple \ intuitive. If the PL2303 is continuously broadcasting data, then Cutecom will display data in hex format
I just got my GUC232A cable with a molded-in PL2302 converter chip.
In addition to adding myself and br to group dialout, I found this helpful tip in the README.Debian file in /usr/share/doc/bottlerocket:
This package uses debconf to configure the /dev/firecracker symlink,
should you need to change the symlink in the future run this command:
dpkg-reconfigure -pmedium bottlerocket
That will then prompt you for your new serial port and modify the
symlink. This is required for proper use of bottlerocket.
I did that and voila! bottlerocket is able to communicate with my X-10
devices.
Putty on ubuntu
There is no need to install the driver for PL2303
So only type the command to enable the putty
Sudo chmod 666 /dev/ttyUSB0
Done
Open the putty.

Resources