Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ESP32 Port of B-Robot_EVO2 Code
03-03-2019, 07:55 PM
Post: #51
RE: ESP32 Port of B-Robot_EVO2 Code
Almost:
https://blogdaichan.hatenablog.com/entry/%3Fp%3D7069
https://cdn-ak.f.st-hatena.com/images/fo...115736.jpg

Best regards,
ghmartin77
Find all posts by this user
Quote this message in a reply
03-04-2019, 07:38 PM
Post: #52
RE: ESP32 Port of B-Robot_EVO2 Code
Nice!
Are those the complete Schematics?
Wondering if you do not measure lipo voltage, and no surge-protection diode? - i already killed 2 esp32 when using 3.3v on the a4988 boards for logic voltage.

started my schematics yesterday but still thinking about the voltage-regulators - switching vs linear, 2 or 1x 5v (separate one for the servos & ws2812) or not.
using 4s 18650 pack.

gonna share schematics/pcb here (_IF_ i make it, still not sure if one bot is enough (with 2 kids..) ;D

Brgds, Martin.
Find all posts by this user
Quote this message in a reply
03-04-2019, 08:50 PM
Post: #53
RE: ESP32 Port of B-Robot_EVO2 Code
I'd say these are the complete schematics from the guy who rebuilt it based on my GitHub page. At a first glance it looks quite complete except a servo but has some LEDs instead.

Actually I didn't use lots of components in my own build. For power supply I'm using 6 AA batteries, supplying the servo directly with the 6V voltage between just 4 of them while the whole pack of 6 powers the motors and a single 5V regulator used for the ESP board. No protection diodes, no voltage measurement. The bot starts to wobble when the voltage is too low. In the worst case it just falls flat, which it anyway does in normal operation if you drive too fast. So no harm at all...

In post #13 in this thread you can find another simple schematics including a servo...

With regards to your considerations about voltage regulators I cannot help. I'm basically a software guy and just learned enough about electronics to put some components together that are at least working but without any knowledge if everything's done properly from an expert's view perspective. Maybe somebody else in this forum can help you with that.
My only advise would be to not put too much complexity into it... ...these 6 AA battery boxes available at aliexpress come really cheap Smile Then a simple L7805 plus a dev board with a 3V3 regulator on it does the trick...

BR,
ghmartin77
Find all posts by this user
Quote this message in a reply
04-05-2019, 06:19 PM (This post was last modified: 04-07-2019 04:58 PM by twinclouds.)
Post: #54
RE: ESP32 Port of B-Robot_EVO2 Code
Edit: I changed "size_t" to "int" and it compiles fine. Hope it will not create any new problems.

(10-14-2017 12:09 AM)ghmartin77 Wrote:  Dear all,

Just in case anybody considers this useful, here you can find my quick&ugly port of the EVO2 code for just a single ESP32 (instead of Arduino + ESP8266 + Brain; Gyro and stepper motor drivers are needed stil of course):
https://github.com/ghmartin77/B-ROBOT_EVO2_ESP32

Have fun!

@JJRobots: Thank you so much for sharing this great project. Had tons of fun rebuilding it Smile

Best regards,
Martin
Hi, Martin:
Very good work! I downloaded the code from the link you provided and installed ESP32 package in Arduino IDE. However, when I tried to compile the code using ESP32 Dev module setting, I got the error: "call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous". Can you let me know if it is o.k. or what I can do to fix? The error message is listed below.

Code:
Arduino: 1.8.8 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default, 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
sketch\MPU6050.cpp: In function 'int MPU6050_read(int, uint8_t*, int)':
MPU6050.cpp:236:77: error: call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous
   Wire.requestFrom((uint8_t) MPU6050_I2C_ADDRESS, (size_t) size, (bool) true);
In file included from sketch\MPU6050.cpp:9:0:
C:\Users\xxxxx_000\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\l​ibraries\Wire\src/Wire.h:93:13: note: candidate: uint8_t TwoWire::requestFrom(uint16_t, uint8_t, bool)
     uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop);
C:\Users\xxxxx_000\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\l​ibraries\Wire\src/Wire.h:94:13: note: candidate: uint8_t TwoWire::requestFrom(uint16_t, uint8_t, uint8_t)
     uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop);
C:\Users\xxxxx_000\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\l​ibraries\Wire\src/Wire.h:96:13: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
     uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop);
C:\Users\xxxxx_000\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\l​ibraries\Wire\src/Wire.h:98:13: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
     uint8_t requestFrom(int address, int size, int sendStop);
exit status 1
call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Find all posts by this user
Quote this message in a reply
04-07-2019, 06:34 PM
Post: #55
RE: ESP32 Port of B-Robot_EVO2 Code
Hi twinclouds,

The interface of the Wire library has changed significantly since I've done the port. Additionally there were some issues with I2C as you probably have already read in this thread or in the "Attention!" section of my GitHub page. If you want to be on the safe side, use this historical version: https://github.com/espressif/arduino-esp...7917e0309c

Hope this helps.

Best regards,
ghmartin77
Find all posts by this user
Quote this message in a reply
04-07-2019, 10:19 PM
Post: #56
RE: ESP32 Port of B-Robot_EVO2 Code
(04-07-2019 06:34 PM)ghmartin77 Wrote:  Hi twinclouds,

The interface of the Wire library has changed significantly since I've done the port. Additionally there were some issues with I2C as you probably have already read in this thread or in the "Attention!" section of my GitHub page. If you want to be on the safe side, use this historical version: https://github.com/espressif/arduino-esp...7917e0309c

Hope this helps.

Best regards,
ghmartin77
Hi, Martin:
Thank you for the tip. I noticed your warning but I thought the issue had been resolved but obviously it has not.
I tried to down load the older version. However, it always hung there. I will try again later.
Regards!
Find all posts by this user
Quote this message in a reply
04-08-2019, 03:00 AM (This post was last modified: 04-08-2019 03:13 AM by twinclouds.)
Post: #57
RE: ESP32 Port of B-Robot_EVO2 Code
(04-07-2019 06:34 PM)ghmartin77 Wrote:  Hi twinclouds,

The interface of the Wire library has changed significantly since I've done the port. Additionally there were some issues with I2C as you probably have already read in this thread or in the "Attention!" section of my GitHub page. If you want to be on the safe side, use this historical version: https://github.com/espressif/arduino-esp...7917e0309c

Hope this helps.

Best regards,
ghmartin77
I download the old directory. Looks like folder esp32 contains the cpp/c codes. However in the post #3 you said I should "rename ESP32BalancingBot.cpp to ESP32BalancingBot.ino" but there is no such a .cpp file. I renamed main.cpp to esp32.ino. However, there are compilation errors. Did I do anything wrong?
Find all posts by this user
Quote this message in a reply
04-08-2019, 06:22 AM (This post was last modified: 04-09-2019 05:59 AM by ghmartin77.)
Post: #58
RE: ESP32 Port of B-Robot_EVO2 Code
You're mixing up things. The arduino-esp32 repository does not contain the code for the balancing bot. It's kind of a library/platform/SDK to support Arduino APIs in the ESP32 world, hence the name *arduino*-esp32. Therefore there's no ESP32BalancingBot.cpp in this repository and you don't have to rename anything. (Renaming isn't even necessary with my code any longer, since I've committed a compatibility change: https://github.com/ghmartin77/B-ROBOT_EV...693e1ec4ad ).

My code relies on the arduino-esp32 library but there were some issues with newer versions and the changes the maintainers of arduino-esp32 did in their code base. That's why I suggested to use an older version of that one instead: i.e. HEAD (read latest) from ghmartin77/B-ROBOT_EVO2_ESP32 but specific one from espressif/arduino-esp32 (as mentioned above).

If you can tell me a little bit about your development environment (ArduinoIDE version? How did you install arduino-esp32 in there? ...), I hopefully can help you with details on how to achieve downgrading arduino-esp32 to the version mentioned...

BR,
ghmartin77
Find all posts by this user
Quote this message in a reply
04-09-2019, 12:10 AM
Post: #59
RE: ESP32 Port of B-Robot_EVO2 Code
Martin:
Thank you your prompt response and willingness for help.
Yes, I am a totally newbie for Arduino/ESP32. I have a lot to learn. I am using Arduino IDE 1.8.8. I just downloaded the installation package and installed on my Windows 10 PC. The Library folder is in C:\Program Files(X86)\arduino\.
Is this what you need?
Your help will be greatly appreciated.
Find all posts by this user
Quote this message in a reply
04-09-2019, 07:37 PM (This post was last modified: 04-09-2019 07:38 PM by ghmartin77.)
Post: #60
RE: ESP32 Port of B-Robot_EVO2 Code
Howdy,

Tried a few things... Really crazy what's going on with the arduino-esp32/IDF platform these days...

Obviously I2C has been fixed with the recent 1.0.1 version of arduino-esp32. I could upload to the chip with 1.0.1 and applying the following change to https://github.com/ghmartin77/B-ROBOT_EV...0.cpp#L236

Quote:Wire.requestFrom((uint16_t) MPU6050_I2C_ADDRESS, (uint8_t) size, (bool) true);

Robot up and running. Yippie! Then I tried to connect to the WiFi AP (using a Galaxy S7) and directly ran into this one:
https://github.com/espressif/arduino-esp32/issues/2285
Maybe related to https://github.com/espressif/esp-idf/issues/2915 ...

After having read several of these issues I gave up trying to get the latest version working. If things the chip was made for (WiFi) won't work without glitches, something really bad is going on Confused

So here's how to activate the old known-to-work version with Arduino IDE.

1) Go to "board manager", search for ESP32 and remove the installed version (most likely 1.0.1 derived from your outputs above).
2) Close ArduinoIDE
3) Download the following zip file: https://github.com/espressif/arduino-esp...e0309c.zip (This is the repository version I mentioned before).
4) Extract this file to C:\Users\[YOURUSER]\Documents\Arduino\hardware\espressif
5) Rename created folder arduino-esp32-32c028a27e6b3c3c3df769bb42f0d87917e0309c to esp32
6) Run C:\Users\[YOURUSER]\Documents\Arduino\hardware\espressif\esp32\tools\get.exe (will take some minutes)
7) Start ArduinoIDE. ESP32 should now be available again in the boards selection menu.
8) Code from my GitHub repository should now compile out-of-the-box.

After uploading (if you have uploaded something built with 1.0.1 before) probably your ESP crashes with something like
Quote:assertion "false && "item should have been present in cache"" failed
If so, stay calm and execute C:\Users\[YOURUSER]\Documents\Arduino\hardware\espressif\esp32\tools\esptool.exe --port [YOURPORT] erase_flash
After that upload the code again with ArduinoIDE. Hopefully at that point thing's are finally working...

BR and good luck,
ghmartin77

PS: Maybe we can give it another try with arduino-esp32 1.0.2 Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)