[ISSUE] mBot Neo voice recognition block is not working


#21

What do you mean “are you signed in to with your account from mBlock.cc (passport.mblock.cc) when uploading these codes?” I signed in with the account created via the makeblock mBlock App.

I also followed the “Getting Started” documentation, but it did not seem to require any other special configuration to use the AI Services. Very odd that everything works but these services, except on mBots that were previously purchased. I got about 10 in December to teach an After School Program at a Private School.


#22

@matt_ailabjunior Indeed, this is strange.

That means you have an account now. What I was wondering.

I guess now we contact support? My mBot 2 charged and it isn’t working either.

support@makeblock.com
in case anyone else seeing this has the same issue.


#23

Does anyone know why Makeblock removed their API documentation from their website in 2023 (or the pages are just blank when you go to them)? I found Python to test the Speech Recognition, but it errors when uploading to the CyberPi.

https://web.archive.org/web/20230326100830/https://education.makeblock.com/help/mblock-python-editor-python-api-documentation-for-cyberpi/

https://web.archive.org/web/20230617145555/https://education.makeblock.com/help/mblock-python-editor-ai-live-mode/


#24

@matt_ailabjunior Actually, this was not intentional. I think their site broke near the end of the year, and they haven’t fixed it yet. :confused: Hopefully, they will get that fixed soon, too.


#25

Have you been able to get any of the Python examples to work? Did they remove support for Python on the CyberPi?


#26

@matt_ailabjunior No to both questions. I can’t really get the docs to work except through internet archive and their readthedocs.io site, and they didn’t remove support either.


#27

As a side-note, I found documentation here on turning CyberPi into an Access Point that other CyberPi’s can connect to.

https://www.yuque.com/makeblock-help-center-en/cyberpi-api/network-api#869eb5a5f405d6c3b3a6618ee89749c3

I uploaded the script and it actually worked.


#28

@matt_ailabjunior Yes, many of the docs have been moved to readthedocs.io or yuque.com for their devices. The docs on yuque are generally fairly thorough (albeit sometimes week toward the end), but at least you can see them.


#29

On Windows PC, I found the API Python modules path.

C:\Users\Public\Programs\mblock\resources\ml\v2\exec\python-env\win\Lib\site-packages\makeblock\modules\cyberpi

Here is the speech recognition URL.

def set_recognition_url(server = 1, url = “http://msapi.passport3.makeblock.com/ms/bing_speech/interactive”):
autoconnect()
return module_auto.common_request(“be139ea20b00673e9e8dcb7bc1640df9”, (server , url ))


#30

@matt_ailabjunior Very interesting. It looks like the API may be down? Or it only takes post requests. Thanks for your help in debugging the issue.


#31

Here are the results from curl.

curl -v http://msapi.passport3.makeblock.com/ms/bing_speech/interactive

GET /ms/bing_speech/interactive HTTP/1.1
Host: msapi.passport3.makeblock.com
User-Agent: curl/8.4.0
Accept: /

< HTTP/1.1 404 Not Found
< access-control-allow-credentials: true
< access-control-allow-headers: utoken,lang,Content-Type,Accept,Origin,Access-Control-Allow-Origin,Cache-Control,accesstoken,token,maccesstoken
< access-control-allow-methods: POST,GET,OPTIONS,PUT,DELETE,PATCH
< access-control-allow-origin: *
< content-type: text/plain
< x-trace-id: d3e6babda3e74297211a88c6759d9aae
< date: Wed, 03 Jan 2024 17:21:53 GMT
< content-length: 18
< x-envoy-upstream-service-time: 1
< server: istio-envoy
<
404 page not found* Connection #0 to host msapi.passport3.makeblock.com left intact


#32

@matt_ailabjunior Yeah, I get about the same:

$ curl -v http://msapi.passport3.makeblock.com/ms/bing_speech/interactive
* processing: http://msapi.passport3.makeblock.com/ms/bing_speech/interactive
*   Trying 120.79.143.40:80...
* Connected to msapi.passport3.makeblock.com (120.79.143.40) port 80
> GET /ms/bing_speech/interactive HTTP/1.1
> Host: msapi.passport3.makeblock.com
> User-Agent: curl/8.2.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< access-control-allow-credentials: true
< access-control-allow-headers: utoken,lang,Content-Type,Accept,Origin,Access-Control-Allow-Origin,Cache-Control,accesstoken,token,maccesstoken
< access-control-allow-methods: POST,GET,OPTIONS,PUT,DELETE,PATCH
< access-control-allow-origin: *
< content-type: text/plain
< x-trace-id: cc5fc11cea5e66005342f712925f161d
< date: Wed, 03 Jan 2024 17:35:36 GMT
< content-length: 18
< x-envoy-upstream-service-time: 1
< server: istio-envoy
< 
* Connection #0 to host msapi.passport3.makeblock.com left intact
404 page not found

I think the issue is that curl makes GET requests, so I’ll try postman later…


#33

@matt_ailabjunior I tried in postman, too, and only get errors. I’d say that the API is down, moved, or removed.


#34

Using curl POST option, it responds with the following.

curl -X POST http://msapi.passport3.makeblock.com/ms/bing_speech/interactive
{“code”:40001,“data”:{},“message”:“请先登录”}

Google Translates to “Please log in first”
请先登录

Looks like their API may be running, but the CyberPi is not talking to it. All of the Python code other than something simple causes a Traceback error when uploaded to the CyberPi.

import cyberpi
cyberpi.console.print(“hello”)

Their website content seems to be back now that was on archive.org. I am going to try to use a 3rd Party Python Editor instead of mBlock to see if it is their IDE.

https://education.makeblock.com/help/program-cyberpi-with-a-third-party-python-editor/


#35

@matt_ailabjunior Ah, so you need an API key parameter. Let me try that again…

I can’t seem to get my key to work with it…

Still not working even if I sync cookies and use an x-api-key? I wonder if cyberpi is having the same issue…


#36

I was able to use the Visual Studio Code to execute the Speech Recognition through the Live mode successfully.

https://education.makeblock.com/help/mblock-python-editor-ai-live-mode/


#37

@matt_ailabjunior Awesome! Could you provide some screenshots? I use VS Code frequently so this will be something I might want. :smiley:


#38

I went back and downloaded version 5.4 of the mBlock IDE and used the code from the Visual Studio Code version and it worked. I am not sure why the Block-based Code does not work still.

I also have not figured out how to successfully upload the Python Code onto the CyberPi to run locally versus through the Live mode.


#39

@matt_ailabjunior
Awesome! So it’s not an API issue, I’ll adjust the title. :wink:
I believe you upload the code like this:
Switch to upload mode, then upload the code.
image

Thanks for the screenshot! Can you provide me with the code, please? I’ll try it later myself. Glad we have some progress!


#40

Code I tested with is below.

from time import sleep

import cyberpi

cyberpi.set_recognition_url()

cyberpi.cloud.setkey(“ENTER KEY”)

This section will be automatically configured in later versions.

cyberpi.wifi.connect(“SSID”, “PASSWORD”)

Set the account and password to those of the Wi-Fi you can access to

while not cyberpi.wifi.is_connect():

pass

cyberpi.console.clear()

cyberpi.led.on(100, 0, 0)

cyberpi.cloud.listen(“english”, 2)

cyberpi.console.print(cyberpi.cloud.listen_result())

cyberpi.led.on(0, 0, 0)

When I do try to upload I get the following error, which I have not resolved yet.

PYB: fast reboot
MicroPython 44.01.008-13-g6cc07873-dirty on 2022-09-21; ESP32 module with ESP32
Type “help()” for more information.

free the memory of this function
event: 0 error occured:
Unhandled exception in thread started by <bound_method>
Traceback (most recent call last):
File “events/event_manager.py”, line 156, in __event_cb_task
File “events/event_manager.py”, line 156, in __event_cb_task
File “events/event_manager.py”, line 121, in __event_cb_task
File “run_app.py”, line 132, in default_task
File “”, line 1, in
File “main1.py”, line 11, in
AttributeError: ‘module’ object has no attribute ‘set_recognition_url’