Unable to connect Arduin Uno with inbuilt wifi to internet - arduino-esp8266

(https://i.stack.imgur.com/9Vx5t.jpg)
This is the board that I'm using Arduino Uno with inbuilt wifi. I'm unable to connect it to my wifi network
I tried doing what is mentioned in the link
https://www.trojanc.co.za/2017/11/05/arduino-uno-wifi-network-setup/
But the webpage won't open
Then I also tried uploading the code mentioned in below link to ESP8266 by pushing on 5th ,6th,and 7th dip switch
https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html
But it still does not connect to the internet
On the terminal it shows
Hard resetting via rts pin
Nothing is visible on serial monitor or arduino IDE
Thanks in advance

There are some switch to control connection between USB, Atmega and ESP8266/Wifi
pin 1 and 2 on : Atmega connect to ESP8266 there is not connection to USB/Computer
pin 3 and 4 on : USB/Computer connect to Atmega, so you can upload a skecth
pin 5 and 6 on : USB/Computer connect to ESP8266/Wifi
make sure you have been setup this switch correctly depend on your need.

Related

Android Things on RaspberryPi3 and HC-05 Bluetooth Classic

I am using Android Things preview 6 image on Raspberry Pi3. Now I have application that can connect to HC-05 when running on Android Phone but same application not able to connect to HC-05 when it is running on Raspberry Pi3 with Android Things.
I can see HC-05 is classic bluetooth device and Wondering as Android things not give popup to enter passkey is making the problem to connect the HC-05 or is there something I am missing
I am getting below error
ConnectThread run: IO Exceptionjava.io.IOException: read failed, socket might closed or timeout, read ret: -1
D/BluetoothSocket: close() this: android.bluetooth.BluetoothSocket#ea69040, channel: -1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream#e5f1b79, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream#173c0bemSocket: android.net.LocalSocket#3f7251f impl:android.net.LocalSocketImpl#284706c fd:java.io.FileDescriptor#c2cf635, mSocketState: INIT
D/BluetoothSocket: close() this: android.bluetooth.BluetoothSocket#4272aca, channel: -1, mSocketIS: android.net.LocalSocketImpl$SocketInputStream#5f2f43b, mSocketOS: android.net.LocalSocketImpl$SocketOutputStream#f7e2758mSocket: android.net.LocalSocket#ec3c0b1 impl:android.net.LocalSocketImpl#7f52996 fd:java.io.FileDescriptor#6129917, mSocketState: INIT
The problem with my HC-05 that it needs pin to pair with Android Things App and as Android Things dont have luxury of user interface we have to set the pin programmatically through app
After few mints of searching I found answer of how to set pairing pin through program from this post programmatically-pairing-with-a-ble-device-on-android-4-4 and it is working perfectly for me. no need to change anything in my app accept added broadcast receiver
Thanks

Blutooth connection fails on Window 7

I am trying to connect bluetooth handset device from windows 7 and above using below link
https://code.msdn.microsoft.com/windowsdesktop/Bluetooth-Connection-e3263296
Windows 10 is succesfuuly able to pair and connect the device but on window 7, device is only paired, socket connect is always failed with error code 10060.
we are using Blietooth API "BluetoothFindFirstDevice" and "BluetoothFindNextDevice" to scan devices and "BluetoothAuthenticateDeviceEx" for sending authentication request to a remote Bluetooth device. On window 7 bluetooth devices shows the handset under paired devices. but socket connect fails.
Does connecting to Blutooth device on window 7 using below API is possible?
I am trying to connect bluetooth handset device from windows 7 and above using below link
https://code.msdn.microsoft.com/windowsdesktop/Bluetooth-Connection-e3263296
Windows 10 is succesfuuly able to pair and connect the device but on window 7, device is only paired, socket connect is always failed with error code 10060.
we are using Blietooth API "BluetoothFindFirstDevice" and "BluetoothFindNextDevice" to scan devices and "BluetoothAuthenticateDeviceEx" for sending authentication request to a remote Bluetooth device. on window 7 bluetooth devices shows the handset under paired devices. but socket connect fails.
Does connecting to Blutooth device on window 7 is possible using above API,s.
https://msdn.microsoft.com/en-us/library/windows/desktop/cc766819(v=vs.85).aspx

In PiTooth.py program after pairing from a second terminal, the program in the other terminal is still "waiting for connection"

I followed this tutorial for emulating my Raspberry pi model B as a bluetooth Keyboard. I am able to identify the pi as a keyboard when searching for connection.
The pairing part is working fine also, I am using the following command for pairing:
sudo blue-simple-agent hci0 <mac address>
The tutorial asks to run the PiTooth code in one terminal and it will initialise the required ports (control and interrupt ports), read the SDP record, advertise the sdp record and it will listen for connection in the control and interrupt port. Then open another terminal and use the above command to pair with the client.
It is getting paired but it not reflected in the other terminal, which is still like "waiting for connection. The following is the part of the python code where it is listening for connection and connecting:
class Bluetooth:
HOST = 0 # BT Mac address
PORT = 1 # Bluetooth Port Number...
def listen(self):
# Advertise our service record
self.service_handle = self. service.AddRecord(self.service_record)
print “Service record added”
# Start listening on the server sockets
self.scontrol.listen(1) # Limit of 1 connection
self.sinterrupt.listen(1)
print “Waiting for a connection”
self.ccontrol, self.cinfo = self.scontrol.accept()
print “Got a connection on the control channel from “ + self.cinfo[Bluetooth.HOST]
self.cinterrupt, self.cinfo = self.sinterrupt.accept()
print “Got a connection on the interrupt channel from “ + self.cinfo[Bluetooth.HOST]
The whole code is really big and I don't like to enlarge the question. Please view this google doc for the code:
https://docs.google.com/document/d/1hEyprvN1MyFqyczL9Qh07_-pJjRvBIEkomiJhLHcXiQ/edit?usp=sharing
Can anyone help me solve this issue. Or is there any problem with the code. Is there any alternative ways to listen for connection.
The issue is resolved. It was an out-of-box solution actually. The problem was with the operating power of the pi. The pi was powered from my laptop's USB port and it's voltage was about 4.4V. USB ports usually provide only 500 mA, 5 V. Raspberry pi need a voltage source of about 4.75 to 5.25V and current in range of 700 to 1000 mA for optimum performance. Exactly how much current (mA) the Raspberry Pi requires is dependent on what you connect to it. For reference about power supply. I just changed the source, I fetched power via a 1000 mA 5v adapter and checked the voltage in the pi, it was about 4.64V and it worked fine.

How to switch wifi channel without dropping connection?

We are developing small internet connected device that connects via wifi and does some work. It is controlled via mobile app.
For configuration purposes we use wi-fi module that can work in both STA + AP modes simultaneously via two interfaces wlan0 and wlan1. One of the interfaces works in Master mode. Phone connects to the device via wlan1 and sends command for the device to connect to another network and waits for result. Device in turn connects to another wi-fi network using wlan0 and notifies the phone if connection was successful or not.
But there is one issue. Both interfaces (wlan0 and wlan1) must work on the same channel as we have single hardware module. This causes channel of wlan1 to change in order to match of channel for wlan0.
Here comes the problem. When channel changes phone looses connection with the device. Is there a way to change wi-fi channel but keep connection between the device and mobile phone?
Our wi-fi module is rtl8723bu.
Linux 3.4.103.
Wifi daemons: hostapd v0.8.x_rtw_r7475.20130812_beta, wpa_supplicant v2.3.
UPDATE
Here is more clearly description what is going on on device.
Let's assume that the phone already connected to Device wlan1 interface with essid DeviceAp which is on channel 1. We have a Router with essid RouterAp which is on channel 6. Device interface wlan0 is not configured and not running.
(Step1 on image below).
Then the phone sends a request to the device to connect to RouterAp.
(Step2 on image below).
When wlan0 starts connecting to RouterAp it changes working channel. Because WiFi module can work only on one channel. The channel of wlan1 also changes (maybe in hard way). Therefore Phone lost DeviceAp and starts roaming.
(Step3 on image below).
SO the update question is:
Is there a way to tell the Phone (or other device) about network change? Or perhaps increase the likelihood that the phone is connected back to DeviceAP.
This behavior is very similar to the process of setting up Google Chromecast.
Chromecast also has two wireless interfaces and change the channel, but the Phone does not lose connection with it.
Image:
http://postimg.org/image/soh78vd17/

Connecting to Pebble watch using Arduino

I am curently looking to find out wheter it is possible to Bluetooth connect an arduino or similar micro controller to the pebble watch using the RN-42 Sparkfun RN-42 adapter
I currently am having difficulty connecting to the pebble, as the board just times out.
Thanks
The RN-42 can, using bluetooth. The following will get you paired, and the watch MAY accept a ping:
SF,1 //factory reset
SP,9999 //takes care of the pairing code
SM,6 //pairing
SA,4
SY,0000 //power
SW,0640 //sniff mode
R,1 //reset so settings are saved/active and pebble should ask to connect
To pass app messages you need to pass some information to the watch, see http://dexwatch.blogspot.com/2015/12/more-on-pebble.html for the full details.

Resources