Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Serial Blocks missing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Serial Blocks missing

by huntcasey on Sun Mar 25, 2018 2:12 am

Hey folks,

I see in the MakeCode documentation that there are blocks that allow you to write out Serial data...

only, these blocks seem to be missing from the MakeCode editor. Can anyone help me get ahold of these blocks?
It seems that there's ways to install extra packages, but I cannot for the life of me figure out how to do this.

I believe I've found the serial package in the github repo, but am totally at a loss.
https://github.com/Microsoft/pxt-common ... /reference

Many thanks!

-Casey
Attachments
InkedScreenshot 2018-03-25 01.05.27_LI.jpg
InkedScreenshot 2018-03-25 01.05.27_LI.jpg (732.93 KiB) Viewed 915 times
InkedScreenshot 2018-03-25 01.03.13_LI.jpg
InkedScreenshot 2018-03-25 01.03.13_LI.jpg (413.54 KiB) Viewed 915 times

huntcasey
 
Posts: 9
Joined: Sun Mar 25, 2018 1:50 am

Re: Serial Blocks missing

by nickine9 on Sun Mar 25, 2018 8:17 am

There is a console.log function which might do. i havent tried it as i use make code for the microbit which has serial functions in a separate group called serial

nickine9
 
Posts: 142
Joined: Fri Jan 06, 2017 4:14 am

Re: Serial Blocks missing

by huntcasey on Mon Mar 26, 2018 10:13 pm

Hey nickine9,

Thanks for chiming in. I've seen the console.log section, but it doesn't seem to have the effect I'm looking for...
Or at least I might be having another problem keeping me from knowing if its working...

When I have the CircuitPlaygroundExpress attached via USB with the code running, the device is not recognized by the computer as being on a port.
But as soon as I click the reset button to put it into bootloader mode, the COM port shows up...

Is it possible to have the board attached and running code while being recognized on a port?
How else can I test if the console.log block is sending data outside of MakeCode?

-Casey

huntcasey
 
Posts: 9
Joined: Sun Mar 25, 2018 1:50 am

Re: Serial Blocks missing

by nickine9 on Tue Mar 27, 2018 5:27 am

again i don't know if it is relevant as I am using microbits rather than the CP but after a certain amount of grief trying to find serial output (on a mac) I found a serial monitor called coolterm which could find the microbit even though it was not viewable in finder.

nickine9
 
Posts: 142
Joined: Fri Jan 06, 2017 4:14 am

Re: Serial Blocks missing

by huntcasey on Tue Mar 27, 2018 8:09 pm

Thanks again for jumping in @nickine9.
I checked out cool Term and indeed was able to monitor a serial data stream from the pre-installed demo on the board... as well as the Hello_Firmata sketch in the Arduino IDE. The CPX appears in the device manager with these sketches... but unfortunately it does not initialize with any code downloaded to the board from MakeCode...

I'm new to programming, but I imagine it has something to do with the following code (from the Hello_Accelerometer sketch) :

Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  CircuitPlayground.begin();
}

It seems since all the serial blocks are missing, this step isnt happening, and thus, the board doesn't appear on the COM port when not in bootloader mode :(

There must be some way of enabling the serial blocks; there well documented, and you can even see them commented out if you go digging through project preferences. But all those files are locked! Maddening! I must be doing something wrong...

-Casey

huntcasey
 
Posts: 9
Joined: Sun Mar 25, 2018 1:50 am

Re: Serial Blocks missing

by adafruit2 on Wed Mar 28, 2018 11:27 am

hey Casey, the Serial output is only available in Windows 10 and if you use the App version (not the browser version). The Serial is actually over HID, so it doesnt work with, like, 'putty' or 'screen'

adafruit2
Site Admin
 
Posts: 19406
Joined: Fri Mar 11, 2005 7:36 pm

Re: Serial Blocks missing

by huntcasey on Wed Mar 28, 2018 2:50 pm

Hey Adafruit2!

I am using the Windows10 app version... but I dont follow the rest of your message completely.
Does this mean its not a true "serial out" connection through a COM port?

What do you mean by : ???
The Serial is actually over HID, so it doesnt work with, like, 'putty' or 'screen'


Would it be possible to describe a scenario using serial as HID? And could you confirm that this would be programmed using the "console" blocks?

I'm probably really trying to stretch whats possible with this board in a 'beginner' environment like make.code, and probably just need to up my skills.
Apologies and thanks!

-Casey

huntcasey
 
Posts: 9
Joined: Sun Mar 25, 2018 1:50 am

Re: Serial Blocks missing

by huntcasey on Wed Mar 28, 2018 2:52 pm

Also, for anyone coming across this, I submitted a query through make.code and got this reply :

Thanks for reaching out. This is a good bug. We did a recent release where we replaced the Serial blocks with “Console” blocks. We had gotten feedback that students didn’t know what Serial data meant/did. So we tried to simplify this. But it looks like we didn’t update our reference docs. We’ll do that now.


I'm potentially in communication with them and will post any updates.

-Casey

huntcasey
 
Posts: 9
Joined: Sun Mar 25, 2018 1:50 am

Re: Serial Blocks missing

by adafruit2 on Wed Mar 28, 2018 3:02 pm

yep! we also opened an issue, but yeah its not 'USB serial" serial, its a special data path!

adafruit2
Site Admin
 
Posts: 19406
Joined: Fri Mar 11, 2005 7:36 pm

Re: Serial Blocks missing

by jpilarski on Mon Apr 02, 2018 9:33 pm

In the makecode pdf from adafruit you list the capability in the makecode windows app to perform "Reading serial message and surfacing them in the editor" but I can't find any serial.Read in java or in blocks. How do you perform serial read as listed in your pdf. I think it's strange microsoft removed the serial blocks and now only have a few functions under the console tab but you can still access the serial.write functions in the documentation https://makecode.adafruit.com/reference/serial/and copy them into your canvas. Please make sure to support serial read and write in the app. It doesn't make sense not to be able to send and receive serial messages. Micro:bit has the capability to work with serial so why wouldn't adafruit.

jpilarski
 
Posts: 8
Joined: Sun Jan 14, 2018 6:40 pm

Re: Serial Blocks missing

by adafruit2 on Mon Apr 02, 2018 9:38 pm

the reason microbit works is they have a separate chip for USB-serial whereas the CPX does not
at this time, makecode does not support USB serial the way Arduino or CircuitPython does. there is no ETA when they will, if ever

adafruit2
Site Admin
 
Posts: 19406
Joined: Fri Mar 11, 2005 7:36 pm

Re: Serial Blocks missing

by jpilarski on Tue Apr 03, 2018 4:08 pm

So does this mean that all the M0 boards will also be without serial.read capabilities on the beta app [url]maker.makecode.com[/url]. I recently purchased the metro express and m0 feather express to experiment with this app in particular. That is such a drag. What is strange is you can still perform several serial.write functions in java and then generate the blocks accordingly but no serial read capabilities. Perhaps there should be a disclaimer on your site because according to this https://learn.adafruit.com/makecode/apps it states reading serial message as a feature of the windows app for circuit playground and on this page https://makecode.adafruit.com/reference/serial it also clearly states that The Adafruit Circuit Playground Express can read data from and write data to another computer or device with a serial connection using USB. Sorry I am not a big complainer and I love your products and I get that makecode is a microsoft product but what is being advertised doesn't match the capabilities of the app and this is really unfortunate because without the serial functioning as advertised the app is a real issue. Perhaps the claims about the app working with serial need to be removed. I could swear that when I first purchased circuit playground express serial read and write worked with makecode but I guess not.

jpilarski
 
Posts: 8
Joined: Sun Jan 14, 2018 6:40 pm

Re: Serial Blocks missing

by adafruit2 on Tue Apr 03, 2018 4:12 pm

ok we updated
https://learn.adafruit.com/makecode/apps to clarify its HID not UART
and we'll let Microsoft know they should update
https://makecode.adafruit.com/reference/serial

thanks!

adafruit2
Site Admin
 
Posts: 19406
Joined: Fri Mar 11, 2005 7:36 pm

Re: Serial Blocks missing

by jpilarski on Tue Apr 03, 2018 4:34 pm

Thanks and I am in conversation with them now on github to see what they can do as well but try and put a little pressure on them please. thanks

jpilarski
 
Posts: 8
Joined: Sun Jan 14, 2018 6:40 pm

Re: Serial Blocks missing

by pelikhan on Thu Jun 07, 2018 1:20 am

We removed the serial blocks as they were confusing... it's not serial in the "expected" way. For now, you can use "console.log" and use the Windows 10 app or run our pxt CLI with "pxt serial-hid". MakeCode uses HF2 which is a small protocol over HID to retreive data from the device. https://github.com/Microsoft/uf2/blob/master/hf2.md

pelikhan
 
Posts: 18
Joined: Wed Sep 27, 2017 12:18 pm

Please be positive and constructive with your questions and comments.