nmcli create Hotspot with HT parametrs - networkmanager

i have created a Hotspot with nmcli command. But the Hotspot have very low bandwidth. After debugging found out that the HT parameters isn't set.
Would like to know how to set the HT parameters using nmcli command.
eg: HT20 and HT40 parameters set in hostapd

Related

How can I send a particular NMEA command as part of the start-up configuration for gpsd?

The GPS hardware I'm using with my Raspberry Pi, if sent the command $CDCMD,33,1*7C, will report the status of the antenna connection.
I'd like this command to be issued whenever my GPS daemon starts. My current config file at /etc/default/gpsd looks like this:
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/serial0 /dev/pps0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"
# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="false"
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"
Is there anything I can add to this config file to insert either the antenna command, or the path of a file containing the command?
I've searched all over for documentation for the config file, yet all I can find is example file, nothing that fully documents what options are available for configuration.
Alternatively, if the gpsd daemon is already up and running, and already has control of the serial port used to communicate with the GPS hardware, is there a way to send an NMEA command that gpsd will pass along to the hardware?
The only way I've been able to test this command was to shut down gpsd, then run minicom to issue the command to the hardware directly.

SIM7020E NB-Iot module does not respond to AT commands

I am using a RPi Pico, a NB-IoT SIM7020E Module from Waveshare and a Twilio Super SIM card. I fitted the Raspberry Pi Pico into the SIM7020E module using header pins: a picture of the setup is given through this link (Picture 1: Hardware setup).
To send different AT commands to configure the modem and set up the APN, I used Micro Python and copy pasted the Python code into Putty (after doing ctrl C, ctrl E and ctrl D to run the code). The main functions I utilised to send AT commands are “uart.write”, “uart.any” and “uart.read”. I have copy-pasted a portion of the code here:
#Send an AT command - just return the response
def send_at_get_resp(cmd, timeout=1000):
# Send the AT command
uart.write((cmd + "\r\n").encode())
# Read and return the response (until timeout)
return read_buffer(timeout)
#Read in the buffer by sampling the UART until timeout
def read_buffer(timeout):
buffer = bytes()
now = ticks_ms()
while (ticks_ms() - now) < timeout and len(buffer) < 1025:
if uart.any(): # check if there is anything to be read
buffer += uart.read(1) # read 1 characters, returns a bytes object
return buffer.decode()
#Send an AT command - return True if we got an expected otherwise False
def send_at(cmd, back="OK", timeout=1000):
# Send the command and get the response (until timeout)
buffer = send_at_get_resp(cmd, timeout)
if len(buffer) > 0:
return True
else:
return False
send_at("AT")
send_at("ATE1")
The issues I have with the code are that:
After sending an AT command (“AT” and “ATE1”), uart.read reads ‘b\x00’ and not the AT command. It looks like the SIM7020E module does not receive the AT command and does not respond to it (I should receive the response “OK”).
The “Read_buffer” function (see code below in picture 2) that reads the command in the buffer by sampling the UART returns an empty string.
Before sending the AT commands, I powered the module on and off to boot the modem using the Pin(14) of the SIM7020E module. When powered on, the module’s LED switches on so I know that my python code can communicate correctly and that the problem occurs for AT commands only.
Alternative 1:
I have tried typing AT commands ("AT" and "ATE1") directly on Putty (I did not hit Ctrl-C to break to the Python REPL), but I received an error message saying that Putty does not recognise the AT command (Picture 2: error with Putty)
Alternative 2:
I also tried using an AT command tester for Simcom modules from the website https://m2msupport.net/m2msupport/download-at-command-tester-for-simcom-modules/, but the software was unable to connect to the USB port (Picture 3: error from the AT command tester). It recognised the port but could not connect to it. The software asked me to try other baud rates and to enable flow control, so I tried all the possible different baud rates, and it did not work. For the flow control, I did not know how to configure it.
I do not understand why the module does not recognise the AT commands despite the other alternatives I tried and if it comes from a hardware or a software related problem. Do you know how I can make my module respond to AT commands?
It doesn't look like you are using the right serial interface in Putty. When you send your AT commands directly in Putty what is the COM5 port? It should be the COM port that shows up under the modem in the device manager.

Reading heart-rate data from a Polarbelt with a Raspberry pi

I am trying to retrieive heart-rate date from a polar belt to use as part of emotion recognition algorithm. I am using a Raspberry pi 3b with raspbian. I am able to connect to the device with bluetoothctl When I open info I get a list of the UUID´s
Here is where it stops. I have tried to use hcitool according to the example below, but that does not work. When I try to connect I get the message: Connection Refused(111)
$ sudo gatttool -i hci1 -b 00:22:D0:33:1E:0F -I
[ ][00:22:D0:33:1E:0F][LE]> connect
[CON][00:22:D0:33:1E:0F][LE]>
So I tried to use bleak and pygatt and I´m not able to make this work. I am quite a newbee, so I am probably doing something wrong. But now I have run out of ideas. Any suggestions will be appreciated.
hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool, ciptool, and gatttool were deprecated by the BlueZ project in 2017. If you are following a tutorial that uses them, there is a chance that it might be out of date.
For testing it is best to use the bluetoothctl tool.
You say that you have successfully connected and get a list of UUIDs. Was 00002A37-0000-1000-8000-00805F9B34FB one of them?
If it is then select that inside bluetoothctl e.g.
gatt.select-attribute 00002a37-0000-1000-8000-00805f9b34fb
If that is succussful then you should be able to read the value with:
gatt.read
Or to test notifications:
gatt.notify on
This should start data being displayed from the belt.
gatt.notify off will stop the data being sent.
If you have this working with bluetoothctl then reproducing it with Python should be done with confidence that the RPi and belt are able to connect successfully.
There is an example of building a BLE client with Python at:
https://stackoverflow.com/a/63751113/7721752
I noticed in your gatttool example you are using hci1 rather than the more typical value of hci0. This is normally the case if you have added a USB BLE dongle. I the above example you would have to change ADAPTER_PATH = '/org/bluez/hci0' to end with hci1.
There is also the example with Bleak at:
https://stackoverflow.com/a/72541361/7721752
For bleak to select an alternative adapter would add the adapter address to the BleakClient e.g.:
async with BleakClient(address, adapter="yy:yy:yy:yy:yy:yy") as client:

Is there a library for MSR605X that works with Raspberry Pi?

I have been trying to locate a working library for the MSR605X magnetic card reader/writer. At time of writing, I have tried five separate libraries. Only two of these were explicitly for the 605X the other three were for the older 605. All the libraries I have tried either did nothing at all or errored before completing a command (can't figure out the errors either).
I am running Raspberry Pi OS 32 bit on a Raspberry Pi 3 B+ the MSR605X communicates via a USB connection.
So far the library that seems to be most complete is: https://pypi.org/project/msrx/
However, I can not get this library to read or write (either nothing happens or I get a Serial exception "cannot reconfig port).
Any help or links to documentation for this reader is welcome.
EDIT: Adding the commands ran with the above library
msrx -D /dev/input/event4 read
msrx -D /dev/input/jso0 read
The -D is to specify the device path (default is /dev/ttyUSB0 which doesn't exist on my system). I obtained the above two paths by searching for USB serial devices then matching the search result to the device ID which I obtained from lsusb.
Running these commands results in a serial exception (could not reconfig port) which I assume means that I have the wrong device path. I have also checked for any tty* device paths that are changed when I plug in the reader. I consistently get a permission denied error whenever trying to run the above commands with a tty* device path (I am root on this system).
msrx author here — MSR605 requires an external 9V power injected into its cable (via the barrel jack port), otherwise it won't power up properly.

How to configure a new network interface in Android

I am trying to configure a new network interface on Android tablet (v3.2).
From terminal application I can
"ifconfig eth0 192.168.11.14 netmask 255.255.255.0 up"
and everything works fine (ethernet cable is connected trough USB-Ethernet dongle)
I want to make this configuration persistent, but it looks like there is no 'interfaces' file in Android.
Where is network configuration file located? Do I need to create new one? Where?
Thanks,
yet another late answer... scoured the internet and couldn't find any decent answer until I checked out /etc/init.sh ...
I'm using an Android Oreo vmware image for testing purposes and here are the steps that I used to add static IP to Android on boot:
Open Terminal Emulator (if not present install from Play Store)
type su
type vi /etc/init.sh
type i
look for function do_init()
before the closing curly brace (}), type post_init_network
create new line after the closing curly brace (}), type
function post_init_network()
{
ifconfig 192.168.63.122/24 up
}
change the ip and subnet as needed...
press :wq! to save and exit vi
power of and power on Android.
To check Static IP:
open Terminal Emulator again after power on, type su, then type ifconfig
NOTE: I encounter this issue where I can't get an IP from NAT network using 2 interfaces where the first interface is set to static IP and the other DHCP, just power on and power off Android until you can get an internet connection.
Sorry for the really late answer. This is more for future reference.
If your ROM supports init.d scripts, try writing one for this. Put the file in /system/etc/init.d/, change its access mode and owner/group to 0755 and root:root, respectively.
Your command will be run at every boot, effectively making it persistent.