Reading Proximity Sensor through BLE


#1

Hi to every one:

First post, and a new Mbot BLE version owner.

So, just a quick explanation regarding my problem:

I’m using Linux and mblock 4.0.4 version to program the mbot. So far everything works fine either by USB and BLE.

Still I have an issue when connecting to the mbot by BLE: While I can set led’s, beep, and so on, I can’t read the ultrasonic value. If connecting by USB, the same code works fine.

So my questions:

  • Is there a way to know which firmware my mbot has?
  • Is there any way, through command line to upgrade the mbot firmware?

I’m asking this because on Linux, there is no option on mBlock to upgrade the firmware.

Thanks for the help!


#2

Hi bitabit,
Before running online program, we have to update firmware. In mBlock 4.0.4, go to connected>upgrade firmware >for mBlock


If your interface is not the same, please kindly show me a screen shot.

To connect mBot to mBlock with Bluetooth without USB cable, there should be Bluetooth dongle with better compatibility.
Thank you!


#3

Thanks for the answer, but it doesn’t quite solve the issue that I have.

What I’m saying is:

  • Running Linux
  • Using mBlock 4.0.0 for Linux (I’ll try version 4.0.4 next)
  • Using the same code that you have on your screenshot.
    • Read sensor value
    • Display value on the Panda

When using the serial connection:

 It works.

When connected and using BlueTooth (My computer DOES have bluetooth, and DOES connect to mbot by Bluetoth) it doesn’t work. It always shows zero.


#4

Hi bitabit,
To connect mbot with mBlock (pc) without usb serial cable, you are suggested to use bluetooth module and USB dongle plugged in computer. USB dongle is not included in mBot package. With bluetooth dongle, we can upload program.


#5

Ok, probably there is some issue communicating…

My computer does have Bluetooth so I do NOT need the Bluetooth dongle.

My computer with mBlock does communicate with mbot using bluetooth.

My computer running mBlock connected with bluetooth with mbot does execute programs.

Rephrasing: I can run scratch programs on mbot when connected to it by bluetooth.

I can do anything using bluetooth with mblock scratch except reading sensor values.

I can NOT read sensor values when using bluetooth.

I CAN read sensor values when using USB serial port.

I’ve already upgraded firmware -> Not solved.

I’ve reset the factory program -> Not solved.

I’ve used the latest mblock 4.0.4 version from github -> Not solved.

Using the android APP or connecting directly to bluetooth using the Nordic App I can read the values.

So the issue is on mBlock program.

I repeat: When connecting by USB cable, I can read the sensor values. When connecting by Bluetooth it does not work reading values.

When using the Serial connection:

When using the Bluetooth connection:


#6

Hi bitabit,
Sincerely sorry for the previous misunderstanding. Since we released Bluetooth dongle, users usually use Bluetooth dongle to connect mblock and makeblock robots, as computer built-in Bluetooth is not well compatible.
mBlock 4 is an experimental version which does have some shortcomings, and I am afraid we will not continue to maintain it. If you have non-Linux computer, please kindly test if there has same issue. Meanwhile I forwarded your case to product department, and we hope to know the version of your Linux system.
By the way, any other blocks you tried are not working, either?


#7

Hi:

Indeed it is a pitty that Linux is not well supported. Very low cost computers for classrooms use some variant of Linux, enven Raspberry Pi’s to keep costs down.

Using cables to connect to mbot is ok for testing and not really for some more complex situations.
Since I do not have the 2.4GHz version, I really don’t know if the issue is also present with that version.

Regading the blocks, every thing works fine, only data that is sent from the mbot to the mblock program when connected by BLE doesn’t work. The serial monitor shows NaN when connected by USB cable shows the response FF 55 …

So it is definitely something on the mblock program since the android Apps work fine.


#8

Later we have plan to release mBlock 5 Linux version, I am afraid no more efforts will be devoted to improve mBlock 4.0.4.


#9

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.