Can we communicate with Xbee from host programatically - python

I am trying to hook up a xbee on arduino and wish to run some algorithms on my linux machine and based on result of algorithmic output i ahve to communicate the commands to xbee connected to my arduino. I know we have API support to read/write xbee from Arduino platform. Does Xbee have a way to be programmed on host machine running Linux/OSx other than x-ctu software.
I wish to know if there is a way to programmatically communicate Xbee using USB dongle adapter from host machine, may be python api

I found this online http://serdmanczyk.github.io/XBeeAPI-PythonArduino-Tutorial/ and it pretty much addresses my need .

Related

Send packet to BLE HID Device

I built a bluetooth keyboard macro, and connected it normally to my linux machine, however I need to send custom packets from Central to the device (in python), as information of which window is currently focused among other things. Is there a way to do this? A two-way communication between device and machine, without needing a dedicated BLE HID client?

Tunnel serial com port windows 10

I'm currently developing a python automation which communicates and control FPGA platform via serial com port. The platform connected to a PC setup in the lab at my workplace. to connect to the FPGA with Python i'm using pyvisa as follows:
import pyvisa as visa
rm = visa.ResourceManager('#py')
self.inst = rm.open_resource('ASRL8::INSTR')
my problem:
To test my code I must pull the new code to the lab-PC.
Is there a way that i'll "tunnel" the serial com port so I can can connect to the FPGA from my PC over LAN ? or any other method that will enable me to connect to the FPGA platform using my development PC ?
*an additional hardware can be considered if needed...
'ASRL8::INSTR' --> 'TCPIP0::LABPC-IP::inst0::INSTR'
Yes, that is called Virtual Com Port, VCP, and can run both TCP and UDP.
Search for "Virtual Com Port TCP" for instance and you get a lot of software you can install to manage that.

mqtt on esp8266 with micropython

I have a modem and four Esp8266 and a Raspberry Pi. I want to control Esp with Python language via internet. I have read this project.
https://randomnerdtutorials.com/micropython-mqtt-esp32-esp8266/
Instead of ESP2, I implemented the code on Windows. But I got the error ModuleNotFoundError: No module named 'ustruct'.
Is there a way for me to remotely check the Raspberry Pi and ESPs using Windows?
Of course I want to use MQTT.
This photo shows what I have described.
ustruct is a MicroPython Module that is available on all if not most MicroPython firmwares ( including the Win32 version of MicroPython)
If you need to / want to port your code to Cpython (on windows or other) that should not be too much work as the two are quite compatible.
as your project needs network capabilities using the Windows port of MicroPython is not an option as neither the Unix nor the Widows ports come with a network stack you compile/download a windows port of MicroPython

Using OSX virtual serial ports with Python

I have a python program that currently reads JSON over bluetooth or usb serial ports and then does some stuff with it.
I want to write another python program that writes to a serial port like a bluetooth or usb device would so I can do some easy testing.
The most success I've found is from this answer Virtual Serial Device in Python?
but I can't find a way to make this work between separate programs
Can anyone provide example code for two separate Python programs that communicate over virtual serial ports?

Communicate between iOS app and Raspberry Pi via Bluetooth

I'm trying to communicate between an iOS app and Raspberry Pi using Bluetooth. The Raspberry Pi is using a Python script for this purpose.
I was originally using the PyBluez library, however this does not support Bluetooth LE and thus can't be used with CoreBluetooth on iOS.
My next solution was to use the private BluetoothManager framework to communicate with the Pi, but this doesn't work on iOS 7.
I've researched a bit more and have seen suggestions for manually sending/receiving LE packets with PyBluez, but this seems incredibly complex and I really have no idea where to start.
So at the moment, I'm stuck. I need either:
A solution to communicate with a non-LE Bluetooth device via iOS, or
A solution for advertising and communicating as a LE device on the Raspberry Pi via Python
One option is to buy a USB dongle with a BLE stack in it already.
We have used the Laird BL620-USB, flashed with BL600 firmware to operate as a BLE peripheral.
Having BLE stack in the dongle means it can be communicated with from the Raspberry Pi like a simple USB serial port, without using any linux Bluetooth stack.
BL600 includes the Nordic / Laird proprietary Virtual Serial Port Profile already, so you can achieve the simplicity similar to the classic Bluetooth SPP, even when communicating to an iOS device.
Laird will provide iOS and Android code to use the VSP on the mobile side.
Other BLE module makers probably do the same.
Have you tried this?
By default, the Wheezy distribution comes without a Bluetooth stack. The bluez package is version 4.99, which has patchy support for Low Energy.
Keep in mind at the time of writing Bluetooth Low Energy (BLE) is not well supported by the standard Raspberry Pi distributions. Some work is required to get it working, as described in the link provided above.
NewAer has built a P2P messaging framework to share 500 Bytes (SDK 5) to 15K with certain devices. That being said, we can send 15K between iOS devices, or iOS and the Raspberry Pi 3. As Android gains further OS and hardware support for BLE, we expect to ad that higher file size as well, but at this time it is limited to 500 bytes between Android and iOS.

Categories

Resources