Serial port not connecting


#1

Hi,

I am new with MBlock and try to connect a serial connection to an Arduino Nano.
My OS is OS X 10.11 (El Capitan) and therefore installed a commercial CH340 USB-Serial driver from mac-usb-serial.com because this seems to be the only signed driver available.
When selecting Connect>Serial Port> /dev/tt0.Repleo-CH341-0000124 the port does not seem to connect.
Also when in Arduino mode the “Upload to Arduino” button shows the "Please connect the serial port."
When editing the code with Arduino, i can connect from the Arduino with the Nano and upload the code.

Any ideas or suggestions how to resolve this ?

Peter


#2

I was able to get the driver you mention to work with a genuine Arduino, but not with the mBot. I had to use the driver here to get the mBot working. This is the WinChipAhead driver that according to Jeroen at mac-usb-serial.com was merely recompiled and signed. Not sure if it will fix your issue or not. Also, make sure that you only have one USB serial driver installed. Otherwise, the driver conflicts will keep things from working properly.


#3

Hi Chuck,

I tried that driver first but got kernel panics on my MBP with 10.11.4 and therefore decided to buy the driver from mac-usb-serial. Will send a support request to mac-usb-serial.com, see what they come up with.

Finally was able to get any form of an error message by starting MBlock from the commandline. When selecting the Repleo serial port i get an “Invalid baudrate” message.


#4

Interesting, I’m on 10.11.3 and I’m not seeing that behavior. Not sure how to fix the baud rate issue in mBlock. I know that when I need to connect via the Arduino IDE I need to reset the baud rate. You might try setting the correct baud rate in the Arduino IDE and then trying to connect to mBlock. I’ll see if I can find where it’s being set and will post where/how if I find it.

UPDATE: It looks like the baud rate is being set to 115200 in the firmware. You may have to use the Arduino IDE to set that.


#5

Hi,
How to install the Makeblock_Driver


#6

@tec_support; Please read the thread, try to understand what it is about and than reply. This is a useless reply.


#7

Hi Chuck,

Tried to set the baudrate in the Library/Arduino15/preferences.txt , but this only sets the baudrate for the serial monitor. Have changed the serial.debug_rate to 115200, but stil am not able to connect to the serial port.


#8

I found this link in StackExchange that seems to be a discussion on your issue although it’s about Yosemite, not El Capitan. It also looks like an unsigned driver because they are recommending the kernel hack to move the kernel into developer mode. There is a link further down to an “official” FTDI driver that appears to be signed that you may want to try.

Also, the Nano does not have very much support in mBlock. Is there a reason you want to use mBlock instead of the Arduino development environment?


#9

Hi Chuck,

Checked the link, but do not think this is the issue i am experiencing here. When in my Arduino IDE or in the embedded Arduino IDE in mblock i am perfectly able to connect and upload code to my arduino’s. Only when making a connection directly from mBlock it fails with an “Invalid baudrate” message.

I want to use mBlock because it is the first Scratch environment which is able to run Scratch without ‘firmware’ installed on an Arduino. Children are also able to upload the generate native code to the arduino so it can run independent from the IDE. Till now this seems to be the best solution to learn kids to code and Arduino with some swithches / leds to create an independent working project.

Just tried to see if a was able to use dtruss to see which baudrate was set from Adobe AIR, but till now no luck.


#10

Interesting. I was never able to get mBlock to work with the Repleo driver. Now I’m thinking about holding off on upgrading to 10.11.4 for a bit. Mucking up my test bed while finishing a book is just not the right thing to do. :slightly_smiling:

There’s always Scratch4Arduino (http://s4a.cat) although you don’t get the code generation that mBlock provides. I’m lobbying to get mBlock ported to Snap4Arduino because in addition to looking/working like Scratch (it evolved from the Scratch BYOB extension), you get first class variables, objects, etc. and the ability to make your own data structures. I’m afraid that it will come down to some of us in the community to do the port because I suspect Makeblock doesn’t have the resources to do so.

I will observe based on having dealt with serial ports for several decades that they are always a pain.


#11

Hi Chuck,

I am able to connect it now :-)grin:


#12

Ok,

I will tell you how to connect your arduino with mBlock :wink:
The issue is somewhere in mBlock not able to handle specific port names, could be length of the name or specific characters in it. Just go to Terminal and execute (after installing the Repleo USB driver);

sudo -s cd /dev ln tty.Repleo-CH341-0000124 tty.ch341

Now connect the Arduino and connect from mBlock using the serial port /dev/tty.ch341

If you are working on a book, plse send me an e-mail when it is available !


#13

Hi Peter,

Great news, I’m happy that you’re connected! I’m betting the reason the short name might be needed has to do with Windows being the primary development environment for the mBlock devs. I sent them a patch a few months ago that made some of the names of the files being included in the Makeblock library mixed case because which works fine under Windows (case-insensitive file system) versus any flavor of Unix (case-sensitive file system). With your permission I’ll include that tip in the set up section of the book with an attribution. You might want to send me a private message with your full name so that I get the attribution correct.

I’ll be posting an announcement in the mBot forum here when the book is out. Hopefully I can finish the editing by the end of the month.


#14

Hi Chuck,

That’s ok. I will send you a private message with my full name and e-mail.


#15

Hi,
I’ve gotten the same issue. I’ve tried to follow your solution @macpeterr but how do I install this Repleo USB driver?

My OS is OS X 10.10.5 (Yosemite).

Thank you.

Cheers,
Emily


#16

You should buy the driver first twee…


#17

After installing the serial driver from mBlock, my system OSX 10.12.1 on 2015 MBP will now crash whenever the mBot Ranger is connected. As I’m on Sierra, has anyone encountered the same thing and been able to resolve it using this approach?


#18

Did you try this http://www.mblock.cc/posts/run-makeblock-ch340-ch341-on-mac-os-sierra ?