CyberPi micropython coding using mBlock


#1

Hello,

Currently I’m investigating the ways of communication between robots of various brands with CyberPi/mBot2. I found out that the most suitable approach is to communicate via MQTT. Unfortunately MQTT is Python coding workflow only, so it is not for the young kids. Also I found out that mBlock is not the best user-friendly Python developing environment for beginners (both mBlock and documentation) or maybe I just missed something?

  1. What is the purpose of ‘Python’ tab in ‘Code with blocks’ editor? I can see console window in the bottom that print some micropython logs in Live mode but I can’t to send python commands directly to CyberPi. Maybe I’m doing something wrong?

  2. ‘Python editor’ has a console in the bottom, but I’m still not able to send commands directly to CyberPi’s micropython. How to run terminal to CyberPi micropython? For example, when I tried to code MQTT client on CyberPi I needed help() and dir() commands to find out what should I import and what methods to use. So the only way was to write those commands in main.py then flash it to CyberPi and see the log window when the CyberPi runs that script. I believe there should be a terminal to CyberPi’s micropython REPL in live mode. How to do that?

  3. Is it possible to mix blocks with micropython code? I was wondering Codey has MQTT blocks by default but CyberPi doesn’t have it.

  4. There is no hints (intellisense) in ‘Python editor’ even for basic CyberPi commands. Maybe somebody would share his experience using another approach to code micropython for CyberPi in another IDE with direct terminal?


#2

Have you seen:
python.mblock.cc

There is also a button that shows you your block code in python.


#3

actually it is the same ‘Python editor’ from mBlock5


#4

Yes, the Python editor in mBlock 5 should do what you need…


#5

Dont worry i got you, for years i’ve seen no one really advanced in cyberpi python, even the mblock admin themselves so i decided to make a mblock server with our own documentations, (yes i am making an add for my server because no one is active in there and there is so much documentation that im doing there that im trying to belive that im gonna delete this server and that my job is made for nothing) so i give you a link if you ever want to ask a question feel free to check there https://discord.gg/duqTctda (also you could see nothing in the cyberpi because of the wrong settings that i’ve made on this discord server so tell me plz if it’s not working :smiley: Have a great day guys :wink:


#6

:+1:
I checked it out! :slight_smile:


#7

you’re really fast :open_mouth:


#8

:smiley: