Can I use easy connect library with the Roving Network XV Wifi module? - mbed

I am trying to create a mqtt connection over WIFI using the mbed LPC 1768 dev board and the Roving Networks RN-XV wifi module. I can create a mqtt connection over ethernet using the HelloMQTT example. I have also created a wifi connect using the WiflyInterface. I would like to be able to create the wifi connection using the easy-connect library or to make the WiflyInterface implement the NetworkInterface.
The current issue is that I cant add WiflyInterface to the mbed-os with getting a Socket redeclaration error.
Error: Invalid redeclaration of type name "Socket" (declared at /extras/mbed-os/mbed-os.lib/features/net/network-socket/Socket.h:28) in "WiflyInterface/Socket/Socket.h", Line: 25, Col: 8

The error message indicates that WiflyInterface's Socket class declaration conflicts with OS 5's Socket class declaration.
I believe WiflyInterface is an mbed OS 2 only library and cannot be added to mbed OS 5 (mbed-os.lib) which comes with its own networking libraries.
You can learn about OS 5's networking libraries here:
WiFiInterface:
https://os.mbed.com/docs/v5.9/reference/wi-fi.html
Network Socket: https://os.mbed.com/docs/v5.9/reference/network-socket.html

Related

programmatically connect to USB devices from USB-over-IP hub Digi AnywhereUSB

Is it possible and how to connect specifically to USB devices, connected to the Digi AnywhereUSB 8 Plus hub, via https, tcp/ip?
Our first idea was to connect USB devices to the USB-over-IP hub and connect to each of the device via IP:Port programmatically with a script locally or e.g. from Jenkins.
I found a document:
Digi International Anywhere USB Library API Specification
https://www.digi.com/support/knowledge-base/anywhereusb-api-information
when installing their driver in following paths.
https://hub.digi.com/support/products/infrastructure-management/digi-anywhereusb/?path=/support/asset-collection/os-specific-drivers-anywhere-usb/
driver install path and files:
C:\Program Files\Digi\AnywhereUSB\Advanced
AwUsbApi.dll
AwUsbApi.pdf
Apparently there are some functions provided e.g. :
AWUSB_STATUS
AwUsbConnect (
IN LPCWSTR Hub,
IN PAWUSB_STATUS Status,
IN DWORD Timeout,
IN HANDLE hEvent OPTIONAL
);
The task at hand is now, how to script a connection to plugged-in USB devices? What language /environment would you suggest?

Can't open HCI socket.: Address family not supported by protocol

I am developing an app that needs to connect to a BLE device, but i cannot find them to establish a connection and read the bluetooth device(yes, it's on) and i can connect it to another app only from this app . So, i try to sniff the bluetooth connection with bettercap in my kali linux running in WSL2, but when i try "ble.recon on" i get:
bettercap v2.28 (built for linux amd64 with go1.14.4) [type 'help' for a list of commands]
eth0: You don't have permission to capture on that device (socket: Operation not permitted)
And, if i try: "hciconfig" i get this issue
Can't open HCI socket.: Address family not supported by protocol
I think that i need to enable my hci socket or something. I need help.
I'm open to other ideas to establish a connection with tis device
Device: M1001 mopeka
App(working): gascheck
WSL2 isn’t allowed access to the network or bluetooth card directly. It is give an internal bridge IP address. From the outside, windows is making the network connections not kali. So, if you need to use this, maybe you can try dual boot.

Write data to ESP32 over USB connection with MicroPython

I have an ESP32 connected to a computer via USB port. I can use the ESP32 to send data over the serial connection using the print statement, I need to periodically write commands into the ESP32. How do I read what is coming over the COM port on the ESP32 in MicroPython? I unsuccessfully tried many variations of the following:
from machine import UART
uart = UART(115200)
while 1:
if uart.any():
msg = uart.read()
print(msg)
Print is for printing in REPL only. If you want to communicate with MCU via serial port you have to write to it.
The simplest example would be:
# your imports and initialization
msg = uart.read()
uart.write(msg)
And on your computer you have to run some serial console e.g. picocom or if you're Windows user then Putty. After connection just type something in terminal and hit enter. This is basically all you need to start echoing messages. You can use Python serial library on your machine but I suggest to stick with simplest tools until you connect successfully for the first time.
Two more things though:
Your init is incomplete imho. It should contain port and timeout options.
You can't use the same USB port for programming and communication (like in Arduino). REPL is going to blow your connection up. You need USB to serial adapter for $2 from China and connect to other UART pins (there are 3 UART interfaces on ESP32).

Tokbox video chat give connection timeout error

It working on same OS machine. If i am publisher with used of mac machine and subscriber side am using ubuntu os then give server connection timeout error.
If OpenTok is working on the same machine but not across multiple machines, the issue is most likely caused by your network. You can check if your network supports webrtc using this tool: https://chrome.google.com/webstore/detail/opentok-diagnostic/elanokbchpinmganpfaigciognfpcfei
If you are using flash, you have to enable rmtp ports. Check your network by going to the flash diagnostic tool here: http://tokbox.com/user-diagnostic/

Virtual COM Communications Issue

I'm working on a Communications Device Class (CDC) driver for an embedded device, a Full Speed implementation of USB 2.0. The COM port settings are 115200, 8-bit, no parity, 1 stop bit, no flow control. Our PC application (32-bit, Windows 7, .NET 2.0) communicates with the target device through a virtual COM port, which on the target device can connect to either a FTDI (USB-to-SCI bridge) chip or the integrated USB peripheral in the microcontroller, depending on which port is selected by the application.
Both virtual COM ports work without any problems using Realterm. However, while our desktop application works using the virtual COM port connected via the FTDI chip, it hangs when attempting to use the virtual COM connected via the microcontroller's integrated USB peripheral.
When connected via the virtual COM port using the integrated USB, the application consistently hangs on the second call to SerialPort.Write(...). Using Serial Monitor from HHD Software I can see that the data is transmitted on the first call to SerialPort.Write(...). However, that data is never received by the target device.
It's odd because the only time I have seen similar problems on previous projects was when the flow control settings on each side of the bus were mismatched.
Additional info...
Here is the data captured from various port monitoring tools while running our PC application connected to the target device via its integrated USB peripheral. Any insight would be appreciated.
Sysinternals Portmon
Advanced USB Port Monitor
Device Monitoring Studio - Request View
Device Monitoring Studio - Packet View
For those that are interested, I am using CodeWarrior 10.2 with the MCF51JM128 from Freescale.
Any ideas or suggestions would be appreciated. Thanks.
It is clear from the logs that you are making the classic mistake of not taking care of the hardware handshaking signals. That only ever works by accident, a terminal emulator like Realterm will never make that mistake.
You must set the DtrEnable property to true. That turns on the Data Terminal Ready signal. It is important because RS-232 is an unterminated bus so is subject to electrical noise when the cable is disconnected or the power turned off. DTR convinces the device that it is in fact connected to a powered device. This is emulated of course in your case but the driver or firmware will still typically implement the RS-232 behavior.
And the RtsEnable property is important, used to handshake with the device and prevent the receive buffer from overflowing when the app isn't emptying the buffer in a timely matter. You really should set the Handshake property to Handshake.RequestToSend, the most common way a device implements it. Which then also takes care of turning RTS on. If you have to use Handshake.None for some reason then you have to turn it on yourself by setting RtsEnable to true.
This ought to take of the problem. If you still have trouble then use PortMon to spy on the way Realterm initializes the driver. Compare the commands you see against the commands that the SerialPort class sends. Make sure they are the same. In value, not in sequence.