How to interface usb wifi dongle to stm32f412 - c

For a RT5370 Media Tek USB wi-fi dongle, after running lsusb -v command on linux, we will get its protocol and class. How to procedure further to implement driver on stm32f412.

Related

adb server always restarts: adb server version (40) doesn't match this client (41)

I can't debug the application to the emulator because adb is unstable as shown in the log below, I tried to do the adb device command three times but the results are different, how do I fix it?
$ adb devices
List of devices attached
emulator-5554 device
$ adb devices
adb server version (40) doesn't match this client (41); killing...
daemon started successfully
List of devices attached
emulator-5554 offline
$ adb devices
List of devices attached
emulator-5554 device

Copying files to mmc device from bootmenu

I want to copy files to mmc device over the network using TFTP.
I know that we can switch to the mmc device using "mmc dev" command at U-boot prompt. After switching to the mmc device, I need to copy the files to the mmc device over the network using tftp from U-bot prompt.
You cannot directly copy from MMC to TFTP.
Go through these step instead:
Setup network:
setenv autoload no
dhcp
Load the file to memory:
load mmc 0:1 $loadaddr /test.txt
The load command set environment variable filesize.
TFTP put:
tftpput $loadaddr $filesize 192.168.1.3:/upload/test.txt
Of course you should adjust the server IP address and the file paths.
In your U-Boot configuration you need:
CONFIG_CMD_DHCP=y
CONFIG_CMD_TFTPPUT=y

Switching between can and vcan

I have read the documentation and I know that:
To enable a real can you do
$ sudo ip link set can0 type can bitrate 125000
$ sudo ip link set up can0
and to enable a vcan you do
$ modprobe vcan
$ sudo ip link add dev vcan0 type vcan
$ sudo ip link set up vcan0
In my case, I even disable vcan before enabling can as in
$ sudo ip link set dev vacn0 down
$ sudo ip link set can0 type can bitrate 125000
$ sudo ip link set up can0
My question is how about the opposite? (Going from can to vcan)?
If my can is up , should I disable it before enabling vcan? and how?
and also enabling vcan uses add not set... why?
There is no connection between real CAN network devices and virtual CAN devices, other than they share the same socket interface.
What you've shown here is how you make either kind of CAN device (real or virtual) active and set it up.
How you'd switch between one and the other in your application should be as simple as using one or the other name for the network device.
You can have real CAN and virtual CAN devices available and up at the same time with no concerns.
As for why you need to add your vcan0 device but not to add your real can0 device, the operating system usually detects your CAN hardware and creates the device automatically.
One exception to this is if you're using a CAN-to-serial adapter with slcand, where you would need to run slcand first (and it will create devices named like slcan0):
$ sudo slcand -o -s8 -t hw -S 3000000 /dev/ttyUSB0
$ sudo ip link set up slcan0

what is the key_code to enable or disable wifi via adb for non rooted device

I have a non rooted Samsung device , i want to enable/disable wi-fi settings for my usages via adb.To open wifi for non rooted device via adb i ran below command
adb -s 4d0075754fdb41cd shell am start -n com.android.settings/.wifi.WifiSettings
By default the wifi is coming as diabled , i want to enable/disable it
I tried with Keyevent , however this did not helped much
adb shell input keyevent 22
The wi-fi slider looks like below , i tried with all available key_code .
Can anyone point me a way to get the correct keycode here!!
You can try adb -s $PHONESERIAL shell "svc wifi enable" if you just want to turn on the wifi with adb.
Was already answered here : android adb turn on wifi via adb
You placed appium tag, so if you using appium, try running:
adb -s $device_id shell am broadcast -a io.appium.settings.wifi --es setstatus enable
adb -s $device_id shell am broadcast -a io.appium.settings.wifi --es setstatus disable

Check if LAN is plugged

i want to check if the LAN cable is plugged in on a linux system, is there any file in /sys or /proc that i can check (i would like to do it in C)?
To check if a cable is plugged you can look in /sys/class/net/
For ex. for eth0 connection:
$ grep "" /sys/class/net/eth0/*
/sys/class/net/eth0/carrier:0
/sys/class/net/eth0/operstate:down
As you can see, cable isn't plugged.
if it was plugged i was getting:
/sys/class/net/eth0/carrier:1
/sys/class/net/eth0/operstate:up
Run the ifconfig command which will show all the interfaces connected.

Resources