Default Serial Activity

Hi, this is a very cool device…

So I am just setting up the basics for debugging and the serial port is outputting a bunch on factory messages instead of my app serial;

Here is a simple app and when I connect to the serial port from my mac or any serial app like Arduino Monitor I get factory stuff.

int count=0;

void setup() {
Serial.begin(9600);

  Serial.println("setup");

}

void loop() {
    
    count++;
    delay(1000);
    Serial.println("loop" + count);

}

below is the output. Note that the flash form the cloud IDE works I get Magenta blinking and all the proper lights and reboot etc… it all looks good except no serial output except the following.

spark/cc3000-patch-version
park/cc3000-patch-version
ark/cc3000-patch-version
rk/cc3000-patch-version
k/cc3000-patch-version
/cc3000-patch-version
cc3000-patch-version
c3000-patch-version
3000-patch-version
000-patch-version
00-patch-version
0-patch-version
-patch-version
patch-version
atch-version
tch-version
ch-version
h-version
-version
version
ersion
rsion
sion
ion
on
n

device.spark.io
evice.spark.io
vice.spark.io
ice.spark.io
ce.spark.io
e.spark.io
.spark.io
spark.io
park.io
ark.io
rk.io
k.io
.io
io
o

SSID: 
SID: 
ID: 
D: 
: 
 

Security 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
ecurity 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
curity 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
urity 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
rity 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
ity 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
ty 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
y 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
=unsecured, 1=WEP, 2=WPA, 3=WPA2: 
unsecured, 1=WEP, 2=WPA, 3=WPA2: 
nsecured, 1=WEP, 2=WPA, 3=WPA2: 
secured, 1=WEP, 2=WPA, 3=WPA2: 
ecured, 1=WEP, 2=WPA, 3=WPA2: 
cured, 1=WEP, 2=WPA, 3=WPA2: 
ured, 1=WEP, 2=WPA, 3=WPA2: 
red, 1=WEP, 2=WPA, 3=WPA2: 
ed, 1=WEP, 2=WPA, 3=WPA2: 
d, 1=WEP, 2=WPA, 3=WPA2: 
, 1=WEP, 2=WPA, 3=WPA2: 
 1=WEP, 2=WPA, 3=WPA2: 
1=WEP, 2=WPA, 3=WPA2: 
=WEP, 2=WPA, 3=WPA2: 
WEP, 2=WPA, 3=WPA2: 
EP, 2=WPA, 3=WPA2: 
P, 2=WPA, 3=WPA2: 
, 2=WPA, 3=WPA2: 
 2=WPA, 3=WPA2: 
2=WPA, 3=WPA2: 
=WPA, 3=WPA2: 
WPA, 3=WPA2: 
PA, 3=WPA2: 
A, 3=WPA2: 
, 3=WPA2: 
 3=WPA2: 
3=WPA2: 
=WPA2: 
WPA2: 
PA2: 
A2: 
2: 
: 
 


 ** Even though the CC3000 supposedly supports WEP,

 ** Even though the CC3000 supposedly supports WEP,
 ** Even though the CC3000 supposedly supports WEP,
** Even though the CC3000 supposedly supports WEP,
* Even though the CC3000 supposedly supports WEP,
 Even though the CC3000 supposedly supports WEP,
Even though the CC3000 supposedly supports WEP,
ven though the CC3000 supposedly supports WEP,
en though the CC3000 supposedly supports WEP,
n though the CC3000 supposedly supports WEP,
 though the CC3000 supposedly supports WEP,
though the CC3000 supposedly supports WEP,
hough the CC3000 supposedly supports WEP,
ough the CC3000 supposedly supports WEP,
ugh the CC3000 supposedly supports WEP,
gh the CC3000 supposedly supports WEP,
h the CC3000 supposedly supports WEP,
 the CC3000 supposedly supports WEP,
the CC3000 supposedly supports WEP,
he CC3000 supposedly supports WEP,
e CC3000 supposedly supports WEP,
 CC3000 supposedly supports WEP,
CC3000 supposedly supports WEP,
C3000 supposedly supports WEP,
3000 supposedly supports WEP,
000 supposedly supports WEP,
00 supposedly supports WEP,
0 supposedly supports WEP,
 supposedly supports WEP,
supposedly supports WEP,
upposedly supports WEP,
pposedly supports WEP,
posedly supports WEP,
osedly supports WEP,
sedly supports WEP,
edly supports WEP,
dly supports WEP,
ly supports WEP,
y supports WEP,
 supports WEP,
supports WEP,
upports WEP,
pports WEP,
ports WEP,
orts WEP,
rts WEP,
ts WEP,
s WEP,
 WEP,
WEP,
EP,
P,
,


 ** we at Spark have never seen it work.

 ** we at Spark have never seen it work.
 ** we at Spark have never seen it work.
** we at Spark have never seen it work.
* we at Spark have never seen it work.
 we at Spark have never seen it work.
we at Spark have never seen it work.
e at Spark have never seen it work.
 at Spark have never seen it work.
at Spark have never seen it work.
t Spark have never seen it work.
 Spark have never seen it work.
Spark have never seen it work.
park have never seen it work.
ark have never seen it work.
rk have never seen it work.
k have never seen it work.
 have never seen it work.
have never seen it work.
ave never seen it work.
ve never seen it work.
e never seen it work.
 never seen it work.
never seen it work.
ever seen it work.
ver seen it work.
er seen it work.
r seen it work.
 seen it work.
seen it work.
een it work.
en it work.
n it work.
 it work.
it work.
t work.
 work.
work.
ork.
rk.
k.
.


 ** If you control the network, we recommend changing it to WPA2.


 ** If you control the network, we recommend changing it to WPA2.

 ** If you control the network, we recommend changing it to WPA2.

** If you control the network, we recommend changing it to WPA2.

* If you control the network, we recommend changing it to WPA2.

 If you control the network, we recommend changing it to WPA2.

If you control the network, we recommend changing it to WPA2.

f you control the network, we recommend changing it to WPA2.

 you control the network, we recommend changing it to WPA2.

you control the network, we recommend changing it to WPA2.

ou control the network, we recommend changing it to WPA2.

u control the network, we recommend changing it to WPA2.

 control the network, we recommend changing it to WPA2.

control the network, we recommend changing it to WPA2.

ontrol the network, we recommend changing it to WPA2.

ntrol the network, we recommend changing it to WPA2.

trol the network, we recommend changing it to WPA2.

rol the network, we recommend changing it to WPA2.

ol the network, we recommend changing it to WPA2.

l the network, we recommend changing it to WPA2.

 the network, we recommend changing it to WPA2.

the network, we recommend changing it to WPA2.

he network, we recommend changing it to WPA2.

e network, we recommend changing it to WPA2.

 network, we recommend changing it to WPA2.

network, we recommend changing it to WPA2.

etwork, we recommend changing it to WPA2.

twork, we recommend changing it to WPA2.

work, we recommend changing it to WPA2.

ork, we recommend changing it to WPA2.

rk, we recommend changing it to WPA2.

k, we recommend changing it to WPA2.

, we recommend changing it to WPA2.

 we recommend changing it to WPA2.

we recommend changing it to WPA2.

e recommend changing it to WPA2.

 recommend changing it to WPA2.

recommend changing it to WPA2.

ecommend changing it to WPA2.

commend changing it to WPA2.

ommend changing it to WPA2.

mmend changing it to WPA2.

mend changing it to WPA2.

end changing it to WPA2.

nd changing it to WPA2.

d changing it to WPA2.

 changing it to WPA2.

changing it to WPA2.

hanging it to WPA2.

anging it to WPA2.

nging it to WPA2.

ging it to WPA2.

ing it to WPA2.

ng it to WPA2.

g it to WPA2.

 it to WPA2.

it to WPA2.

t to WPA2.

 to WPA2.

to WPA2.

o WPA2.

 WPA2.

WPA2.

PA2.

A2.

2.

.

The device is obviously suggesting some things but the network is WPA2 and the core is online in the cloud… so how do I get this guy to output my serial?

thnx

Neil

The output you pasted are messages displayed to the user when they are sending Wifi credentials via usb!

It’s interesting why you see them while using Serial :stuck_out_tongue:

Is the core breathing cyan?

yes it is breathing cyan, the output is interesting it has output around SSID down a bit in the output but not outputting my network details (which is good)

spark serial monitor /dev/tty.usbmodem1421 > sparkoutput.txt this is how I am opening with the CLI

1 Like

I’m getting the same results. Digging further now :wink:

Using this works:

int count=0;

void setup() {
    Serial.begin(9600);
    Serial.println("setup");
}

void loop() {

    count++;
    delay(1000);
   Serial.print("loop ");
   Serial.println(count);

}

So this core was previously claimed by me, then got all locked when I tried to test PN532 example code…

Did a factory reset this morning device is back… claimed it on wifi app through ipad then started back to basics with serial test…

so I think this has something to do with the claim process.

I ran spark setup just now and it dies errs out on the last step when breathing cyan …

Serial said: Awesome. Now we'll connect!

If you see a pulsing cyan light, your Spark Core
has connected to the Cloud and is ready to go!

If your LED flashes red or you encounter any other problems,
visit https://www.spark.io/support to debug.

    Spark <3 you!


Done!  Your core should now restart.

Please wait until your core is breathing cyan and then press ENTER


========================================
Claiming your core

Failed to claim core, server said  [ 'Device is not connected' ]
Please wait until your core is breathing cyan and then press ENTER

Failed to claim core, server said  [ 'Device is not connected' ]
Please wait until your core is breathing cyan and then press ENTER

Failed to claim core, server said  [ 'Device is not connected' ]
Please wait until your core is breathing cyan and then press ENTER

Failed to claim core, server said  [ 'Device is not connected' ]
Please wait until your core is breathing cyan and then press ENTER

Failed to claim core, server said  [ 'Device is not connected' ]
Please wait until your core is breathing cyan and then press ENTER

Error setting up your core: Out of tries [object Object]

I’m thinking it’s a firmware and i am able to replicate it. Trying to figure out what’s going on! :smile:

so in the setup…

right off the start it asks

----------------------
Finding your core id

Press and hold the MODE button until your core blinks solid blue

 - Is your core blinking blue?  Then press ENTER - Potentially unhandled rejection [2] Timed out (WARNING: non-Error used)

I doubt the unhandled exception is normal output for the procedure… is the setup supposed to return an ID of the core and could that be where it is failing to get a response from the device?

Neil

OK the setup was a red herring, I got the setup to complete by removing the core via WEB GUI and then running through the USB setup…

I revoked the token to gen a new one for auth and all seemed good for claiming as well.

I did some tests in the code and just left Serial.begin() no writes … and the connection is static but connected which is good but if you try Serial.wrrite or Serial.println - then you get all the setup buffer feed.

It seems that somewhere in the firmware you guys must be pointing to the wrong buffer for the Serial output…

This is kind of a key item :smile:

Thanks!

I have opened a github issue here: https://github.com/spark/firmware/issues/350 :wink:

Thanks @kennethlimcp!

@fed007, I believe the problem is with this line:

Serial.println("loop" + count);

The argument “loop” + count is not valid! It needs to be expressed as two print statements.

1 Like

yep that worked, those damn web compilers … interesting to say the least how close the mem address for that buffer was, makes me want to dig deeper now :smile:

Neil

Separating the differently typed print messages as @peekay123 says will always work.

If you want to have it in a single print statement, you can wrap up the const char * as a String object:

Serial.print("loop" + 15); // unintentional pointer math
Serial.print(String("loop") + 15); // you get what you expected

yep! good stuff , I hope you guys aren’t storing details plain text in mem…

Neil