Previously we demonstrated how to achieve control on Makeblock car with cellphone software “ITEAD Bluetooth Robot Panel” by using BTBee with MBoard. Recently, we introduced another WIFI Bee module with functions similar to BTBee which supports inserting XBee interface to achieve converting WIFI (Supporting IEEE802.11b/g/n) into serial port. Therefore, today we want to show you how to achieve control on Makeblock car with "" software by using WIFI Bee with Mboard.
First, we need to set up a Makeblock two-wheel drive car. Fix MBoard, and connect the motor to MBoard. Inset WIFI Bee directly into the XBee socket of Mboard. Since there is no network LED on WIFI Bee, we will insert an LED electronic brick into Mboard to observe network conditions. Connect LED electronic brick to EB5 of MBoard with the connection cable specifically for electronic bricks.
Then download the program for this example. After opening the file, it cannot be directly downloaded onto MBoard, as we need to do some modifications according to the user's network environment before compiling the program. First, fill in router settings information according to the actual network environment , among which, "SSID" is the name of the router, "KEY" is the router's encryption key, "IPADDRESS" is WIFI Bee's IP address, "NETMASK" is router’s subnet mask, "GATEWAY" is the router gateway and "PORT" is the connection port for WIFI Bee . Subnet mask and gateway information of the router can be obtained from the computer. Let’s take WIN7 operating system as an example, click on the computer's "Local Area Connection" under "Network and Sharing Center", and then click on "details", the corresponding subnet mask and gateway values can be seen in the information table. WIFI Bee’s connection port value "PORT" serves as a monitoring port for TCP server, and the parameter value can range from 1 to 65535.
After modifying the configuration of codes according to the actual situation, the program can be written into Mboard- as Mboard uses ATMega32U4 chip, there is no need for external adapter plate such as FOCA, and it supports directly connecting to the computer via USB cable and downloading program with IDE.
For details of introduction on cellphone control software "ITEAD WIFI Robot Panel" which needs to downloaded, how to download and to use the software, you can refer HERE.
Before using the software, you must have WIFI Bee module work. After connecting lithium battery to MBoard to supply power, you can see LED electronic brick blinking for a few times, which indicates that the wireless network is being configured. When the LED electronic brick stays illuminated, it indicates that it is already configured and connected to a wireless router ready for the device to be connected. Then you can open "ITEAD WIFI Robot Panel" software on the cellphone, click "setup", and then the Client Settings interface will appear on the cellphone. Fill WIFI Bee's IP address (IPADDRESS value) into the client's address bar, which is "10.0.0.134"in this example. Then fill WIFI Bee port number (PORT value) into the right grid, which is "5000"in this example. Then click the "Start Connecting" button. If it is successfully connected to WIFI Bee in the car, the client will prompt "Already connected to server!" and LED electronic brick in the car will be turned off, then you can start WIFI communication. Then return to the original joystick interface, and you can click on any of the direction buttons to control movement of the car toward that direction. When the button is released, the car will be stopped.
However, as the communication is through a router, if there is packet delay, it may cause control hysteresis. For example, after the button is released, the car is not stopped in time. Because it is only a demonstration, we did not do detection and troubleshooting, you can modify the codes to achieve a more complete and more stable remote control. Alternatively, you can set up WIFI Bee as an access channel and directly connect your cellphone to WIFI Bee to fix the problem.
More about this article: Makeblock 2WD Car With WIFI Bee