[FIXED] Wemos MotorShield V1.0 NO i2c-adress

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

[FIXED] Wemos MotorShield V1.0 NO i2c-adress

#1 Post by tomtom » 09 May 2020, 16:27

Good day guys,
I have several problems with my wemos motorshields. In the last days I ordered 4 of those shields and no one is working on my wemos.
I prepared a wemos D1 mini pro with the i2c scanner library, but no one of my boards can be found. Probably I missed something to get these things working, but I tried almost all I've found.
At first I tested the bare boards with the i2c scanner, after that I tested the method with STM32 flashing tool to getting a direct access to the stm, but none of that worked.
Now I'm thinking about to bou a ST Link programmer to flash the STM32 with a new firmware.

Can anybody help me to find out what's the problem of the boards?
Last edited by tomtom on 16 May 2020, 07:01, edited 1 time in total.

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Wemos MotorShield V1.0 NO i2c-adress

#2 Post by ThomasB » 09 May 2020, 19:14

Now I'm thinking about to buy a ST Link programmer to flash the STM32 with a new firmware.
That sounds like a reasonable idea. If you purchased all the non-functional boards from the same supplier then maybe they are missing firmware. Regardless, the original firmware is buggy. So you should reflash the MotorShields with updated firmware. Details are explained here:
https://www.letscontrolit.com/wiki/inde ... otorshield

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#3 Post by tomtom » 09 May 2020, 20:07

Hi Thomas,
i tried the "Installation" in your link many times with my TTL programmer now, but i cant find the motorshield.
All i´ve got is:
fail.PNG
fail.PNG (3.08 KiB) Viewed 16231 times
Probably i need the ST Link programmer for this behavior?
Another solution is the "We have a fixed Firmware" in this link:
https://hackaday.io/project/18439-motor ... rogramming

But i need the ST link programmer for this too.

Ruprecht
Normal user
Posts: 18
Joined: 04 Nov 2016, 10:02
Location: im Süden von DE

Re: Wemos MotorShield V1.0 NO i2c-adress

#4 Post by Ruprecht » 09 May 2020, 21:44

You don't need an ST-Link programmer, just the program stm32flash and the new motor_shield.bin firmware and an USB2TTL adapter.

You may have the same problem that I had at first. The instructions for changing the firmware are not complete. It is described that before programming "Short the RTS and the 3V pins on the shield together". However, the description lacks that this connection must be removed after programming.

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#5 Post by tomtom » 09 May 2020, 23:36

Hi Ruprecht,
yes i already know that, but i can´t flash the firmware, whenever the USB2TTL programmer doesn´t recogize the motor shield.
I soldered the RTS and 3V pins together, hooked up everything like in the description and powered the TTL programmer up.
After checking the right COM port in my device manager, i wrote down the first command into cmd and got the "Failed to init device" message back.

If you check your own motor shield, a simple i2c scanner is able to find your device on the arduino, but mine has no i2c adress - the computer/TTL programmer can´t find it, because the STM32 chip probably has no i2c adress yet.
It´s difficult for me to find out whats the problem now.
Last chance for me to directly access the STM32 chip with the ST-Link programmer (solder two wires to the legs of the STM32 chip) https://cdn.hackaday.io/images/9683431479845007181.jpg
and directly modify the flash on it with the motorshield.bin firmware, otherwise all of the shields are bricked or whatever...

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Wemos MotorShield V1.0 NO i2c-adress

#6 Post by ThomasB » 10 May 2020, 00:20

yes i already know that, but i can´t flash the firmware, whenever the USB2TTL programmer doesn´t recogize the motor shield.
The ST-Link programmer has been reported to work better than USB programming. Some say it is because of the chance of using an incompatiabe UBS-TTL dongle.
but mine has no i2c adress - the computer/TTL programmer can´t find it, because the STM32 chip probably has no i2c adress yet.
I suspect that your boards are missing firmware. But maybe they have been connected wrong.

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#7 Post by tomtom » 10 May 2020, 10:21

I tried 3 different serial adapters now.
With cp2102, ftdi and pl2303 chips. None of them found the motor shields.
Let's wait for the st link programmer to do further testings

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Wemos MotorShield V1.0 NO i2c-adress

#8 Post by ThomasB » 11 May 2020, 03:55

Here's instructions on how to use the Wemos D1 for programming the MotorShield (instead of USB-TTL).
https://github.com/thomasfredericks/wemos_motor_shield

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#9 Post by tomtom » 11 May 2020, 09:23

Hi Thomas,
thanks for your help, but I tried this too.
Doesn't work for me. I have to wait for the ST Link programmer, this is the only possible solution now.
Hope to get this boards working soon.

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#10 Post by tomtom » 14 May 2020, 13:01

Hi guys,
now I'm one step ahead.
I was able to flash all my wemos motorshields with the MotorShield.bin file from the link:
https://hackaday.io/project/18439-motor ... rogramming

I connected my fully loaded 3S Lipo battery to GND and VM of the shield, wired my DC motor to A1 and A2 of the shield and put the MotorShield beside the wemos on a tripple base.

At first I flashed the wemos with the espeasy firmware and did the setup for MotorShield under the devices tab (GPIO 4 and GPIO 5) for i2c. The i2c scanner found the shield on i2c adress 0x30 how expected.
Next step was to send an command to the wemos. I used the http method to send the FORWARD command over network to the board and got the OK message back.
The logfile of the espeasy told me, that it has received the command successfully, but the motor doesn't spin.

I did a lot of tests and none of my motorshields send the commands to the connected motor.
At least I flashed the wemos with a simple sketch to directly spin the motors and controlled the output in the serialmonitor. It seems the motor has to move now, but he didn't.

After many hours of testing I'm really frustrated about this stuff.
I don't know what the problems of the boards are.

Did I anything missing?

Which library must work on the firmware I've flashed to the wemos motorshields?

Or do you have any other ideas?

Best regards,
Tom

User avatar
Ath
Normal user
Posts: 3481
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Wemos MotorShield V1.0 NO i2c-adress

#11 Post by Ath » 14 May 2020, 13:11

Is the voltage of the battery enough to get the motor turning? Possibly the voltage drops too low when it tries to turn...
/Ton (PayPal.me)

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#12 Post by tomtom » 14 May 2020, 17:05

The battery is full. It powers the motor with 12.4V.

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Wemos MotorShield V1.0 NO i2c-adress

#13 Post by ThomasB » 14 May 2020, 21:38

I used the http method to send the FORWARD command over network to the board and got the OK message back.
Unfortunately the MotorShield plugin responds "OK" to nearly everything, even if the command syntax is wrong or the motorshield board is dead. As a cheap sanity check, please post the exact http command you used so we can see what was sent.

Honestly, you're at a place where you need to get an electronics buddy over to your workbench to review all the little details. Sometimes a fresh pair of eyes can spot something important.

If you like to use our eyes then post (1) a screenshot of the motorshield's plugin settings, (2) clear photos of all your wiring so that we can see what you have built, and (3) any rules you have written.

BTW, if your test hardware is using a breadboard with temporary plug-in wiring (Dupont cables, alligator clip wires, etc.) then it's time to get out the soldering iron and make more reliable connections. Too many projects have been derailed due to those "temporary" connections that look fine but aren't.

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: Wemos MotorShield V1.0 NO i2c-adress

#14 Post by tomtom » 15 May 2020, 00:29

Hello again.
I got it finally working!
Here's my solution of the latest problems.
I had to solder the jumper RTS and the Jumper i2C on the bottom of the board together. This was needed to control the board via wemos.
After I got it with a simple wemos MotorShield library working, I had to flash the espeasy.
After that and new configurations on the esp web UI, I tried again to control the motor per http commands and it didn't works again.
I found out, that the motor drains the battery with the predefined 0,5A and 7V, but it wont spin.
To fix this problem I had to adjust the example of the http command from the value of 99 (Motorspeed) command to 20 and after that it runs.
I can't explain why the motor wasn't able to spin with 99, but now everything is fixed and all of my motorshields are working very well.
Now I'm ready to finalize my project.

Thanks to all helpers in this forum.

Best regards,
Tom

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Wemos MotorShield V1.0 NO i2c-adress

#15 Post by ThomasB » 15 May 2020, 01:12

Great to hear you solved the problem. BTW, what is the name of the ESPEasy bin file you loaded into your Wemos D1 Mini that is working?
I had to solder the jumper RTS and the Jumper i2C on the bottom of the board together. This was needed to control the board via wemos.
Regarding the solder jumpers, they should look like the photo below:

motorshield_600.jpg
motorshield_600.jpg (118.1 KiB) Viewed 15938 times

Edit: I updated the wiki and added this solder bridge image.
https://www.letscontrolit.com/wiki/inde ... otorshield

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#16 Post by tomtom » 16 May 2020, 07:10

Hi Thomas,
I used this firmware ESP_Easy_mega-20200426_normal_ESP8266_4M1M.bin

Now I probably found an bug, while I was building my project.
Do you have a BH1750 sensor and a MotorShield?

Please try both modules together.
The MotorShield has i2c adress 0x30 and the BH1750 sensor has i2c adress 0x23.
If I was using the bh1750 alone, it works very well. Same for the MotorShield, but when I connected both, the wemos rebooting all the time or it doesn't find any wifi connection.

Edit:. Can you advise me, how to bugfix the espeasy without WiFi connection?
Do espeasy write logfiles into the flash?

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#17 Post by ThomasB » 16 May 2020, 08:00

Do you have a BH1750 sensor and a MotorShield?
I have the MotorShield, but not a BH1750.

Which BH1750 board are you using? Link to supplier would be helpful. Reason I ask is because some have I2C pull-ups sourced by 5V, which I think may cause problems. If this is what yours has then these two resistors should be removed.
Can you advise me, how to bugfix the espeasy without WiFi connection? Do espeasy write logfiles into the flash?
You can enable the serial log feature in the Advanced settings page. Then all activity will be sent to the serial console for debugging.

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#18 Post by tomtom » 16 May 2020, 08:55

Hi Thomas,
i´m using the GY-302 Board for the BH1750 sensor.

I used putty to check the serial output of the board and yes, how i thought. the board is rebooting all the time, if both, motorshield and bh1750 connected.
boot.PNG
boot.PNG (34.44 KiB) Viewed 15846 times
EDIT:

Thats the board i´m using
bh1750.PNG
bh1750.PNG (423.16 KiB) Viewed 15845 times
And thats the way i´ve connected it with the wemos d1 mini pro:
Untitled.jpg
Untitled.jpg (197.69 KiB) Viewed 15845 times
EDIT 2:
I found this schematic of the GY-302(BH1750) board.
Probably the two resistors in the red cycle of the picture below are the same as my 103 (10k) SMD resistors on the board.
Can I desolder them or what should i do?
schematic.png
schematic.png (199.85 KiB) Viewed 15842 times

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#19 Post by ThomasB » 16 May 2020, 18:13

I found this schematic of the GY-302(BH1750) board.
Probably the two resistors in the red cycle of the picture below are the same as my 103 (10k) SMD resistors on the board.
Can I desolder them or what should i do?
The schematic you posted shows that the pullups are sourced by 3.3V. So that's good (do not remove them). But as a sanity check, use your voltmeter and confirm.

Try a different 5V power supply. Some are "noisy" and cause reboots.

Also, I suggest you install a much older ESPEasy bin file. For example, the branch on Mar-15-2019 when the plugin was officially released. If that works then you'll know there is a bug in the more recent releases.

- Thomas

tomtom
Normal user
Posts: 15
Joined: 30 Apr 2020, 20:14

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#20 Post by tomtom » 16 May 2020, 19:12

Ok, i measured the Pullups and they´ve 3.3V on the Pinside.

I flashed the branch from March 15, 2019 and had the same issues.
The board can find a wifi network and is booting normally
- if the BH1750 is connected AND the motorshield (WITHOUT soldered RST pin) is connected too, but cant find the i2C adress from the motorshield
- if the BH1750 OR the motorshield (WITH soldered RST pin) is connected

It is rebooting all time
- if BH1750 AND motorshield WITH soldered RST pin is connected

Edit: I measured the Voltage after the pullups from the MotorShield too. There are only 0.55V outgoing. Should they have 3.3V too?

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: [FIXED] Wemos MotorShield V1.0 NO i2c-adress

#21 Post by ThomasB » 16 May 2020, 19:27

Edit: I measured the Voltage after the pullups from the MotorShield too. There are only 0.55V outgoing. Should they have 3.3V too
Strange problem. I'm running out of ideas. Here's some final hail Mary things to try (one at a time, not all at once):

1. Did you try a different 5V power supply? There have been many reported reboot problems that were related to dirty power.

2. Disconnect RST reset on the MotorShield. Do a cold boot (remove power, apply power). Does it boot correctly on a cold boot?

3. Are your wire leads short? Long leads can cause I2C problems.

4. Disable NTP time. See if that helps.

5. Change I2C ClockStretchLimit value on the Advanced settings page.

6. Disconnect the 5V power connection from the MotorShield. Instead, power the MotorshShield from 3.3V.
Edit: I measured the Voltage after the pull-ups from the MotorShield too. There are only 0.55V outgoing. Should they have 3.3V too
I think you'll need to use an O-scope to see what is going on. Could be normal I2C activity or evil latched-up signals.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests