How do I set transmission and receiving frequency band in contiki in CC1200 driver? - contiki

How do I set transmission and receiving frequency band in contiki in CC1200 driver?
https://github.com/contiki-os/contiki/tree/master/dev/cc1200

Related

find the packet loss rate in mosquitto mqtt

I want to use the mqtt message broker mosquitto to receive the value of each sensor to the Raspberry Pi and to monitor the message delivery success rate of each sensor. In order to obtain this information, we need to calculate the packet loss rate. Can I get the information from within mosquitto?

Why is 802.11 to 802.3 conversion impossible in monitoring mode?

When I use Wireshark to capture traffics with my wlan card with monitor mode already set, it only displays 802.11 frames. However, if I use Wireshark with managed mode wlan(promiscuous mode), it certainly displays 802.3 frames.
I searched for some related information and found out that 'network bridging' allows devices to convert 802.11 wireless packets to 802.3 packets. In case of packet capturing, pcap allows conversion.
(link: How to real time convert wireless packet(802.11) to Ethernet packet(802.3) in windows?)
So, Why is 802.11 to 802.3 frame conversion impossible when using monitor mode(not associated to the wireless network)?
Below are pictures of the situation. Thank you in advance.
Promiscuous mode packet capture
Monitor mode packet capture
For one thing, not all 802.11 packets have Ethernet equivalents; only data packets do. In monitor mode, in addition to data packets, control and management packets can be captured - you're seeing those types of packets in your monitor-mode capture.
For another thing, when capturing in monitor mode on a "protected" network (WEP, WPA), data packets are encrypted (to protect them from being sniffed), and can't be converted to Ethernet packets until they're decrypted. Under some circumstances, Wireshark can decrypt them, but Wireshark doesn't do any conversion from 802.11 to 802.3 in any circumstances - when not capturing in monitor mode, the 802.11 adapter converts data packets to 802.3 packets after decrypting them, and doesn't show non-data packets to the host.

LoRa point-to-point connection receiving packets

I would like to use LoRa (not LoRaWAN) to send a measurement from a LoRa device to a M5 Stack (esp32) with a LoRa module using a point-to-point connection.
Is it possible to save that measurement to a database (using WiFi) after it is received by the M5 Stack? Will I be able to access the content of the received packet by the M5 Stack?
Also, if this is possible, how many devices could send measurements to the M5 Stack?
Edit:
I'm using the Firebase Realtime Database. I'm already storing some data into the database using a normal M5 Stack, but I'm not sure whether it would work with the packets received from LoRa. I'm planning to use a LoRa temperature sensor. The message should contain the temperature measured, timestamp and battery level. The LoRa packet should be sent every 30 minutes.

How does Linux kernel wifi driver determine when a connection is lost?

My understanding is that current WiFi driver uses rate control algorithm to choose a data rate within a small set of predetermined values to send packets over the WiFi medium. Different algorithms exist for this purpose. But how does this process work when WiFi driver decides that the connection is lost and shutdown the connection all together? Which part of the code should I read in open source WiFi driver such as MadWiFi and the likes?
The WiFi driver for your hardware which runs in Linux communicates with the WiFi chip which also runs a pretty complex firmware. The interface between the driver and the firmware is hardware specific. In some hardware the detection of connection loss events is done completely by the firmware and the driver only gets a "disconnected" event while in others the driver is also involved.
Regardless of who does what disconnection usually occurs due to either
Receiving a DEAUTH frame from the AP
Detecting too many missing beacons. Beacons are WiFi frames sent periodically by the AO (for most APs every ~100ms) . If you get too far from the AP or the AP was just powered off you stop seeing the beacons in the air and usually you'll signal disconnection or try to roam to a different AP.
Too many failures on Tx of packets (i.e. not receiving ACK frames for too much traffic)
This usually indicates that you've gone too far from the AP. It could be that you can "hear" the AP but it can't hear you already. In this case it also makes sense to signal a disconnection.
For example you can look in TI wifi driver in the Linux kernel drivers/net/wireless/ti/wlcore/events.c and the function wlcore_event_beacon_loss()
In Cfg80211 architecture, assume we are station mode.
driver call kernel API cfg80211_send_disassoc() if we received a deassoc/deauth frame.this function will notify corresponding application (ex wpa_supplicant) a disconnect event.
on another hand, when we decide to disconnect with AP, applicantion (ex wpa_supplicant) can call linux kernel API cfg80211_disconnected(), it will trigger corresponding driver ioctl function to finish disconnection task.

WLAN triangulation of mobile devices from WLAN side as a pose to cell phone app

Im trying to measure the signal strength of mobile devices from either existing WLAN routers or creating directional antennas. I want to see what specific routers are picking up the top 3-4 signal strengths from a specific mobile device, and use triangulaiton to gather their locaiton. Any ideas of the best route to do this?
I don't know whether such router exists or not, but can provide you an alternative and convenient way. Wireless channel is symmetric in both direction; this is, if the router transmits signal at 20 dBm and mobile device receives such signal at -30 dBm, the received signal strength at router would be -30 dBm if the mobile phone transmits at 20 dBm (given that environment does not change much). Then simply install WiFi analyzer app on your Android phone and record the signal strength of your normal routers.

Resources