How to get compass module to work with mBot


#8

D’Oh! I just realised that I forgot to plug in the 2.4G dongle! So ignore my last post. :blush:

I am now using the upgraded firmware, without resetting the default program.

The compass module is giving values - hooray!

The ultrasonic module is also returning correct values.

I guess the confusing part (for me at least) is that the ‘upgrade firmware’ is an alternate to the default program. Maybe if they were labelled as ‘beginner’ and ‘advanced’ that would make it more obvious that they are alternatives, not something you can apply both.


#9

Does this suggest that some Makeblock products are supported by boards running the “firmware” but not the “default Program”?

I am constantly amazed that Makeblock finds new and interesting ways to misuse common phrases.

When I do Upload Firmware, the upload completes with a single beep. When I reset the board, it does not make the three tones of the default program. I had always interpreted this to mean that the board was not ready to communicate with the mBlock - ie, did not have Makeblock Firmata loaded. I can see now that this was incorrect.

Is the program labeled “firmware” just Firmata without the IR controls? Is there a list of what sensors/products are disabled when running the “default Program”?

–andrew


#10

Wow. Using the “update firmware” instead of “default Program” also allows tethered mode to address all 30 LEDs on the strip. When the default program is on the board, the LED strip output is capped to 15.

Who knew?!

–andrew


#11

It seems that the three beeps are part of the ‘default program’, the single beep is the startup for the ‘upgraded firmware’. So yeah, once you get that one beep, it’s good to go. As long as you don’t want to use the IR remote without adding your own code for that, and you don’t get the inbuilt line follower and obstacle avoidance modes. But you do get support for all the sensors it seems.

As a total guess (based on past Arduino coding experience), I’d say that there isn’t enough room on the board to include the IR code, the line tracker code, the obstacle avoidance code, and all of the libraries for all of the sensors. So they ship it with some basic support, and if you buy more sensors that’s when you upgrade to the firmware that has all the libraries (but not the demo modes). Just guessing.


#12

The core of my frustration is that we’re all “just guessing.”

I agree with your assessment that program size might limit some support libraries. Befuddled as to why that would cause the 15-LED limit. It could also have to do with having an interrupt set for signal from the IR port?

Ok. Now we just need to get those terrible names replaced. Not only do they not describe the difference between these two modes, but the names MEAN OTHER THINGS.

–andrew


#13

Hi tieandjeans,

The default program is previous uploaded program from factory. With the default program, customer can play the robot by default modes through IR controller or mobile APP.
Customer can also write and upload their own program to the main board to play the robot in the other way.

As for upgrade firmware, it is needed when you want to run program online. Please refer to this document, it may help you understand the upgrade firmware.


#14

`I’ve read that document, and similar posts to this, several times. My problem is that both use words that don’t match either their technical or common English usage.

The first problem is “run the program online.” Online, in conversational English, normally means “connected to the Internet.” Makeblock uses it to mean “run with an active serial connection (wired, Bluetooth or 2.4g) to mBlock.” This is really confusing.

The other big problem is “firmware.” Arduino programs compile to .hex files and upload to volatile RAM, so they can technically count as “firmware.” But in conversational English those are called “programs.” Firmware normally refers to something that’s a lower-level part of the device. Looking through the Arduino documentation, the only discussion of “firmware” comes when discussing the separate Atmel chip that handles USB-Serial on the Uno.

https://www.arduino.cc/en/Hacking/DFUProgramming8U2

As @mjg mentioned above, using “program” and “firmware” to distinguish between these two is super confusing. It’s bad for novice users, because “firmware” sounds intimidating. It’s worse for intermediate/advanced users, who have incorrect expectations based on the language used.

Can you link to, or provide filenames for, the non-complied .ino files for each of these two? At this point, I’d really like to read the files and see what’s actually going on.

–andrew


#15

Dear tieandjeans,

Thanks for sharing your opionion. I will provide the feedback to our company.
As for the .ino file, you can install the arduino software and makeblock library refer to this link: http://learn.makeblock.com/en/learning-arduino-programming/
Then you can find the two .ino files refer to the picture below:


#16

Is mbot_firmware or mbot_factory_firmware the “default program?”

–andrew


#17

Hi Andrew,

The mbot_factory_firmware is the default program.


#18

I have the same problem as tieandjeans, trying to get the compass (and the 3 axis accelerometer and gyro) to work.

-I have the mBot connected with the serial cable.
-I have upgraded firmware
-I have NOT reset the default program
-My code is very similar to what tieandjeans had to query the compass (and 3d acc & gyro) and say the results
-when I run it from mBlock, the code runs, but I just get 0 values

-if I use mBot Program (and use write line instead of say), let mblock generate code, and then edit in Arduino, and upload from Arduino, then it works, I get reasonable values in the serial terminal.

so, I am still missing a step somewhere?


#19

Hi tgraphic,

You may refer to this document to upgrade firmware again to make sure you have done it correctly.1. How to Upgrade Firmware for mBot.docx.zip (690.6 KB)
Then please run the mBlock program online again.

Once still 0, please paste your program here.
Besides, which port you connect the me compass to the mCore board?
If it is possible, you may take a video to show whole your operations and result.


#20

Tec Support, Wa Hoo! now it works. The missing step was in the document you referenced:

" if your PC is Mac, you need pay attention to two points bellow
Before upgrade firmware, need install a driver for Mac, here is the link to download the driver. …"

My computer is a Mac. As soon as I installed that driver (and restarted, and did ‘upgrade firmware’ again), then it worked.

Thanks!


#21

Ok, I spoke too soon. It did work once. I have a 3 axis accelorometer/gyro and a compass connected. And was getting readings on all axis, and from the compass. So that was good. Then I did something else with the mBot, and came back to this. I did ‘upgrade firmware’ again, and ran the program. Now I was getting a number (Not 0) it was 121.xxxx, but I was getting the exact same value for each axis of the accel / gyro and for the compass. The values did not change as I moved the sensors.

I turned everything off, disconnected everything, and stopped the mBlock program. Then I started mBlock up again, reconnected the mBot, etc. And did 'upgrade firmware again. Now when I run the program I am back to all 0s again. :frowning2:

Do I have to install that driver (and restart) every time?

Here is the program:


#22

Hi tgraphic,

You may try the 3 axis and the me compass one by one again.

  1. Test X-Axis accelorometer/gyro:

    Run above program and rotate the module with this direction:

  2. Test Y-Axis value:

    Run above program and rotate the module with this direction:

  3. Test the me compass:
    Before you test the Me compass, please calibrate it first refer to following steps:

  1. Connect Me Compass to Makeblock main board correctly, power on, and then download any one of the compass library we provide.
  2. Press the key on the module until the blue light of the module start flashing, then let go of the key.
  3. During the flashing of the blue light, spin the module (including the mechanical structure connected with it) along the horizontal plane for over 360° steadily.
  4. After the spinning, press the key on the module to exit the calibration. Now the blue light on the module will be solid on.

Here is a link for more info of Me compass.


#23

Hi tech_support,

I tried again. It does not matter if I read one sensor (axis) at a time, or all at once, I still get 0s for everything.

I tried this:

  • I reinstalled the extra driver that the Mac requires again:

" if your PC is Mac, you need pay attention to two points bellow

  1. Before upgrade firmware, need install a driver for Mac, here is the link to download the driver."
  • Then again I upgraded the firmware in mBlock.

  • Now the sensors give varying values again. So success.

But do I really have to reinstall that driver (and restart my laptop) every time I want to use this? To test this, I did some other things with the mBot, that required uploading software to the mBot, then came back to the sensor program.

  • I upgraded the firmware in mBlock, and ran the sensor program
  • I got a value that was not 0, this time it was 38.xxxxxx, for every sensor, and it didn’t change when I moved the sensors. So it was not working
  • I quit mBlock, turned off the mBot, disconnected it, and started again. This time when I ran the program I got all 0s again. Still not working

For one more verification… that ‘need [to] install a driver for Mac, here is the link to download the driver.’ really is the required missing step, I installed it again - restarted my laptop, then started mBlock, etc. and upgraded the firmware again. And now the sensors work again.

This seems strange. And it is certainly inconvenient. But … I can make it work


#24

Hi tgraphic,

Normally, there is no need to re install driver and upgrade firmware again to use it.
Here I test a me compass and 3 Axis, they have no such issue.
May I know what is the system version on your Mac and which version mBlock do you use. It is suggested to use latest version mBlock 3.4.5.

Besides, do you have any other PC to give a try which may help to determine if the issue is on the sensors or not.


#25

Hi Tec_support,

My mac book pro runs OS X El Capitan version 10.11.6. The mBlock is version is 3.4.5.

I have also tried the sensors using a Windows 7 PC, with mBlock and mBot, and they do work as expected there.

So this issue only occurs with my Mac laptop.


#26

Thanks for the feedback!
Here is a new version mBlock 3.4.6 now, you may check if the same issue on your Mac laptop with mBlock 3.4.6.


#27