Recently I have been experimenting with IPv6 over BLE. I started by using a Raspberry PI, a Nordic semiconductor nrf51 device and sample code supplied by Nordic. I had no problems getting a COAP server up and running on the Nordic device and was able to access the server from the Raspberry PI using a COAP client.
My next step was to try and send data between two Raspberry PIs, using IPv6 over BLE.
To do this at the slave end:
sudo su
echo 1> /sys/kernel/debug/bluetooth/6lowpan_enable
hciconfig hci0 leadv
So at this stage the slave is advertising
At the master end
sudo su
echo 1> /sys/kernel/debug/bluetooth/6lowpan_enable
hcitool lescan
Make note of slave MAC address
echo "connect MAC address 1" > /sys/kernel/debug/bluetooth/6lowpan_control
ifconfig
Confirm existence of bt* interface
hcitool con
To confirm connection
ping6 -I bt* ff02::1
The above works for a short time and is quite unstable. Next I would like to send data back and forth from slave and master. At the master end, I have an interface which can be used to send data, but at the slave end I have nothing. I guess I need to set up a bt interface at the slave end, so data can be sent back and forth.
Any suggestions or recommendations would be appreciated.
Related
I emulate the firmware of a embedded device with qemu-system-arm. The output of the console is working fine by appending "console=ttyAMA0" to the kernel. On the guest there is a binary which opens another serial port for communication (bi-directional) on /dev/ttyGS0 and listens on that port. Now I need to connect to this port from the host, to send commands to the binary and receive the output.
I already tried different things like creating character devices and pseudo ttys, but I don't know how to define the serial device for the guest.
Is there a way to do this?
Thanks in advance.
If you pass multiple -serial options to QEMU they will be interpreted as defining what you want to do for UARTs 0, 1, 2, etc. So for example "-serial stdio -serial tcp::4444,server" will send UART 0 to your terminal and connect UART 1 to a TCP server on port 4444 which you can then connect to with netcat or similar utility. (You can connect serial output to a lot of different backends, not just stdio or TCP: check the QEMU documentation.)
(NB: this relies on your board model actually creating multiple UARTs and wiring them up to the command line options correctly, of course.)
I wanted to test if my UART(ttyMT1) is working on my custom board (android project). I have 2 UARTs on my board- ttyMT0 & ttyMT1. UART ttymt0 is my debug port. I have microcom on my board as well.
Test1:
I connected Tx and Rx of ttyMT1 with a female to female jumper wire. Then, on my ADB, i opened microcom for ttyMT1 using the below command:
microcom -s 115200 /dev/ttyMT1
On my debug port (using minicom), ttyMT0, I transmitted to ttyMT1 using echo as shown :
echo -ne 'Hello' > /dev/ttyMT1
and i was able to get the transmitted data print (HELLO) on ttyMT1.
What i wanted to know was, is this enough to verify that my UART ttyMT1 is working fine or do i need to try something else?
Test2:
What i tried again was to connect ttyMT0 to my PC's usb port and ttyMT1 to another USB port of my PC using 2 separate USB to UART connectors. Then i opened 2 minicom, one for each and tried to transmit the same Hello from ttyMT0 to ttyMT1 (ttyMT0 shows as ttyUSB0 on my PC and ttyMT1 as ttyUSB1). But i didn't receive any print on ttyMT1. Why is that?.
p.s. I'm unable to type anything on ttyMT1. I probed ttyMT1 on Oscilloscope and i got the Tx signal but I didn't get anything on my scope when I probed on Rx.
I think you need to have SELinux permission to access serial port in android. However check this code here to read serial port : https://programmer.help/blogs/serial-port-operation-with-jni-method-under-android.html. It will require you JNI.
I'm engaging in dev. project which uses BlueZ v5.26 and TI CC2564 chip.
Recently there needs to change BT MAC address to be in the range of that customer owns. To meet, I used hci command as chip maker guides in the following link. And, I also tried with 'bdaddr' tool in bluez.
http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_BD_Addr_.280xFC06.29
It looks controller MAC address is changed, but Bluetooth daemon still keeps chip original MAC address. Bluetoothctl shows original address. When trying to pair with BLE device, authentication failure happens at the moment. I guess it's because of this address mismatch in the daemon. Is there any way to make bluetooth daemon to use revised address after updating MAC with HCi command?
Thank you for the answer in advance.
I've installed the Arduino virtual USB serial port driver, it's appeared as COM4 on my device manager. I double checked by listing all available serial ports in powershell
> [System.IO.Ports.SerialPort]::getportnames()
COM1
COM4
However, when I try to do an echo to the serial port, it says it does not exist
> echo helloworld > COM4
The system cannot find the file specified.
I am trying to upload some firmware in to my arduino, but I kept getting denied by the port. Trying a different USB gives me the same result. I wrote a small program to test the serial port and I get the error:
The serial port "COM4" does not exist.
The device name of a serial port on Windows is \\.\COMn where n is the port number. A device driver can emulate the DOS device name, like "COM4" if it chooses to do so, very simple to do in the device driver code. But that's an increasingly rare thing to do, especially for port numbers larger than 2 and extra especially for port numbers larger than 4. So seeing your echo command fail is not unusual.
A serial port cannot be shared, it can only be opened once by a process and everybody else that tries to open it will get the fail-whale ERROR_ACCESS_DENIED error code. Necessarily so, serial ports sit at the very bottom layer of the OSI model, there is no protocol that arbitrates access to the port. Or to put it another way, the operating system has no guidance on who should get the data that the port receives. There can be only one candidate, the process that opened the port first. So the error message you got is not unusual, you have to make sure that nobody else is using the port. Including the Arduino serial port monitor.
Background
I am trying to connect to a serial GSM - modem of Wavecom type.
I was able to communicate with the modem using the guide
http://www.easysw.com/~mike/serial/serial.html
on my Ubuntu machine.
but when I tried to connect it through a device with serial port and running on Linux kernel Linux 2.6.14.7-tiny1-WR1.3al_small I get junk data returned. I have tried all of the baud values to connect to the modem. It connected on 115200 baud value when it was working, but the same value does not work from this Kernel. Its a ARM target machine. note : I cross compiled the code for ARM
Question
Do I need a driver for a modem to just be connected through a serial terminal Program ?
Please make sure that the RS232/TTL converter of your ARM board is working correctly. for example you can connect it to your Ubuntu machine at first and transmit something with a terminal program.
question : 1 ) Do i need a driver for Modem to just be connected through a Serial Terminal Program ?
No.You can connect to your GSM modem simply by having a serial port and a terminal program.