在第五课中我们是使用蓝牙控制小车。在本课中我们升级一下,用wifi控制小车。除了蓝牙改成wifi控制,其他功能和第五课一样。
在本课中需要 用到一下器件
Device Name
|
picture
|
qty
|
Arduino UNO
|
补部件图片100 x 100
|
1
|
ESP8266 扩展板
|
补部件图片100 x 100
|
1
|
Motor with wires
|
补部件图片100 x 100
|
4
|
L298N MOTOR driver module
|
补部件图片100 X 100
|
1
|
Box for 18650 3.7V battery+
DC power connector
|
补部件图片100 x 100
|
1
|
voltage meter
|
补部件图片100 X 100
|
1
|
舵机
|
补部件图片100 X 100
|
1
|
超声波
|
补部件图片100 X 100
|
1
|
云台
|
补部件图片100 X 100
|
1
|
蜂鸣器
|
补部件图片100 X 100
|
1
|
循迹模块
|
补部件图片100 X 100
|
5
|
Jumper wires(male-male,male-female,female-female)
|
补部件图片100 X 100
|
若干
|
底盘
|
补部件图片100 X 100
|
1
|
1)底盘、电机、L298N电机驱动板以及Arduino UNO安装,请参考第一课中关于电机测试的介绍:
2)超声波、舵机安装请参考第三课介绍:
3)循迹模块安装请参考第四课介绍:
首先将将ESP8266扩展板上插到Arduino UNO上,
并将ESP8266上两个拨码开关拨到如图所示位置
Step 1: Install latest Arduino IDE (If you have Arduino IDE version after 1.1.16, please skip this step)
Download Arduino IDe from https://www.arduino.cc/en/Main/Software?setlang=en , then install the software.
Step 2:Download Lesson One sample code from https://osoyoo.com/driver/smartcar-lesson6.zip , unzip the download zip file smartcar-lesson6.zip, you will see a folder called smartcar-lesson6.
Step 3: Connect Arduino UNO to PC with USB cable, use Arduino IDE to open the file smartcar-lesson6.ino in smartcar-lesson6 folder, load the code into arduino
Step 4 下载安卓手机APP:https://osoyoo.com/driver/car.apk
并安装手机APP,将esp8266扩展板的两个拨码开关拨到图示位置
Final Testing :
Step 1:打开电池盒侧面电源开关
Step 2:打开手机WIFI,在WIFI热点列表中可以看到”DOIT_Configxxxx”的热点,这是一个免密的wifi热点,连接这个热点,打开手机APP,选择Wifi
进入wifi连接界面,在此界面顶部有连接状态指示,如果连接上wifi,状态会变成”connected”
小车一共有3种工作模式:手动模式、循迹模式和避障模式,三种模式之间可以自由切换。
1) 在手动模式:顾名思义就是认为控制小车 运动,可以通过APP上前进(^)、后退(V)、左转(<)、右转(>)和停止(||)按钮控制小车运动;按一下APP上的”obstacle”按钮,小车进入自动避障模式;按一下APP上的”tracking”按钮,小车进入自动循迹模式;
2) 循迹模式:将小车黑色轨道上,具体可以参考第四课
按一下APP上的”tracking”按钮,小车开始自动循迹,点击APP上的前进(^)、后退(V)、左转(<)、右转(>)和停止(||)按钮可以切换成手动模式;按一下APP上的”obstacle”按钮,小车进入自动避障模式;
3) 避障模式:按一下APP上的”obstacle”按钮,小车进入自动避障模式。点击APP上的前进(^)、后退(V)、左转(<)、右转(>)和停止(||)按钮可以切换成手动模式;点击APP上的”tracking”按钮进入循迹模式。
DownLoad Url osoyoo.com
I have completed all 5 lessons. I am able to use bluetooth communication with the DIP switches set to off (1.2). However, when I turn off the power, remove the bluetooth module, move the DIP switches to ON, turn power back on, restart the CAR application, select “WiFi”, connect phone to the shield’s SSID via WiFi, I am unable to get the application to connect to the car. The application only indicates that it is “disconnected”. What could I be doing wrong?
Do you go to phone setting to connect wifi and restart the APP?
Yes. I have done that:
1. turn car power off
2. remove bluetooth card
3. flip DIP switches to “ON”
4. Turn car power on
5. Disable WiFi on phone
6. Force close CAR app
7. Enable WiFi on phone
8. Connect to “DoitWiFi_Config”
9. Launch CAR app
10. Select “WiFi” mode
Then, the app says it’s “connected” already (indicated at the top) I try a command: step forward. It works. The app immediately displays “Connection disconnect” near the bottom and the status at the top says “disconnect”. After that, the CAR app is not able to connect until I close and reopen the CAR app. Then I get to run one more command.
Also, if I disconnect and reconnect from “DoitWiFi_Config” I am able to run another *single* command without restarting the CAR app. Same result of disconnect immediately following the command.
Are you willing to tell me the version of your Android?
i have the same problem, and i don’t know how to solve it
I need an answer as soon as possible
I think the wifi expansion board may be defective.
Are you willing to provide your order No. and I’ll send the board to you and please have a try.
OK?
Hi, I completed all the 5 lessons. The car worked well in the previous lessons, but now I installed wifi module and bluetooth, I connect with the phone app, and car doesn’t do anything. What can I do?
I noticed that the voltage display shows 6.8. Can be the voltage too low?
1. Do you mean the wifi and bluetooth module can’t work as the tutorial?
2. The voltage need more than 7V and then the car will work smoothly.
Yes, the car doesn’t move. I can’t control the car with the app. How can I solve?
Which version Android of your phone is?
Do you put the swtich to on when it work on wifi?
My phone has Android 4.3
Yes, I put the switch to on wifi.
Which can be the problem?
I think the wifi expansion board may be defective.
Are you willing to provide your order No. and I’ll send the board to you and please have a try.
OK?
OK, my order number is 171-5077738-6650706. From Amazon.
ok, we will reship the board to you today and give you the tracking number via amazon email massage.
Ok
Hi, I completed the car. But I think it goes too fast, and before avoid obstacles it bangs on them. How can I do?
Hi, I tried all 5 lessons for the smart car kit I ordered and received about a month ago. Unfortunately, I experienced failures in two lessons. They are as follows.
(1) Lession 2 – Car does not move at all with the IR remote control although I can see LED lights brinking on IR receiver board.
(2) Lesson 5 – Wifi control does not work properly. Pushing any button (forward, back, left, or right turn) and releasing changes connected to disconnected status immediately and this forces start over with new wifi connection. This means sequential control is not possible without reconnecting wifi. Bluetooth does not work properly either. Car motion is not continuous even when you keep pushing any control buttons. Car makes short move and stop.
My phone is with android version# 8.0.0 and battery meter showed initially 8.4 and lately 7.8 volts after some trials. The product order number I got from Amazon is 112-3383311-2641052. Please let me know what needs to be done.
Sincerely
Kwang Cho
please to check the wire connections, modules’ installations and software installations carefully firstly,and make sure they are all right.Could you please try it? any update?
I am confident that hardware and software installation and wiring were all done correctly. I tested several times on different days after verifing correct installation and wiring and the same problems were observed.
Could you please change a phone which android version below 4.4 to try it, any update?
I think the user report by Derrickoson on April 3, 2018 mentioned a problem similar to my problem in lession 5: Wifi is disconnected immediately following a *single* command.
Could you please change a phone which android version below 4.4 to try it, any update?
I discarded all my old phones and cannot test android version below 4.4 as you suggested. How can I switch back to old android version with my current phone? My Samsung phone shows installed version number 8.0.0 and does not say how you can go back to old version. I am also concerned that switching back to old version might cause other functionality issues. Was the Osoyoo Smart Car designed to work only with old android version?
our engineers are updating the software of the phone app which can support android version above 4.4 these days , but it need a few days, could you please wait for some days?
Ok, fine. I can wait for the lession 5 problem. How about my lession 2 problem of no operation with remote IR control although LED lights on IR receiver board blink. Any idea what could be wrong?
please visit: https://osoyoo.com/2017/07/20/arduino-lesson-ir-remotecontrol/?preview_id=9211&preview_nonce=aeac5d434c&_thumbnail_id=14649&preview=true
and check whether the infrared receiver and infrared remote control are in good condition or not?
we have updated the phone app which can support android version above 4.4, please uninstall the previous APP, then download the new app. in Android phone from the link: https://raw.githubusercontent.com/osoyoo/driver/master/BTcar.apk.
Hi Elaine, thank you for the updated wifi remote control App. It works great with my latest android version. However, I still see two different problems. Bluetooth control fails to perform continuous car motion when I keep pushing control buttons: car repeats short motion. I am wondering whether Bluetooth mode in the App needs to be updated as wifi mode for new android versions. Per IR control problem for lesion 2, I checked the IR receiver board by connecting to Arduino hardware as you suggested. Demodulated hex code observed through serial monitor for control buttons such as left, up, etc. do not match with those in test program. The code is also not consistent. Doesn’t this indicate my IR receiver board is bad?
Hi, we have updated the phone app again, please uninstall the previous APP, then download the newest app. then to try Bluetooth fuction again, any update?
As for Per IR control problem, please offer the hex code of top, down, right, left.
Kwangcho, to help you solve the problem sooner, could you reply us by email to [email protected] . If this is our hardware problem, we will send you replacement to you, and if this is software set up problem, we will give you guide to reinstall the program.
please visit: https://osoyoo.com/2017/07/20/arduino-lesson-ir-remotecontrol/?preview_id=9211&preview_nonce=aeac5d434c&_thumbnail_id=14649&preview=true
and check whether the infrared receiver and infrared remote control are in good condition or not?
Hi, I completed the car. But I think it goes too fast, and before avoid obstacles it bangs on them. How can I do?
hi , again , tracking mode dont work good it always go out line , and i havent 90 degree lines . i tryed to lower the spedd of the car but dont work too
how can i do ??
I have a problem in Bluetooth mode. When I start the app and connect to bluetooth it says ” connected you have modified the parameters.I have no idea what happen or how to clear it, what it does it will not let the car continually go forward, you have to hit the button each time to move it forward.Any help would be appreciated.
yes. the car is designed to move a short distance after each hit. We do this because we do not want the car moving too fast otherwise it might hit obstacle and damage. If you want to longer movement after one hit, you might need customize the code in void do_Drive_Tick() function. Try different value for JogTimeCnt and see the result.
In wifi if I hold the forward button it will continue moving until I let it go. I did notice on the screen in Bluetooth it will display forward on the phone screen, but in Wifi it shows a . I don’t know what that means. If I haven’t hooked up to the computer why is it saying”connected you have modified the parameters” What parameters is it talking about?