-
• #2
Your first attempt:
var wlan = require("CC3000").connect(SPI1, B6, B7, B8);
Seems like the correct one - but did you set up SPI1 beforehand? You'd need to use
SPI1.setup({ mosi: .., sck: ..., miso:.., baud:1000000, mode:1)
to make sure it's working on the right pins and in the correct mode (CC3000 seems to use a different SPI mode to normal for some reason).Unfortunately the software TI provides for their module is awful - if you initialise it with the wrong information, it just crashes and never returns (rather than erroring).
-
• #3
Thanks for the quick reply, @Gordon!
Unfortunately, setting up SPI1 doesn't fix it (that would be too easy). A
.connect()
call with no args always works, but.connect(SPI1, B6, B7, B8)
always hangs, whether I set up SPI or not.At least now I know I'm not going crazy, and this is actually weird.
I'm thinking of just getting an ESP8266, unless there's WiFi module folks recommend.
-
• #4
I just tracked this down - it turns out that there was a regression which meant that
mode
inSPI.setup
wasn't getting read correctly.If you use the latest Pico firmware from Git (which annoyingly doesn't come in a CC3000 flavour!) then it'll be fixed and the following will work:
SPI1.setup({ sck:B3, miso:B4, mosi:B5, baud:1000000, mode:1}); var wlan = require("CC3000").connect(SPI1, B6 */ CS */, B7 /* EN */, B8 /* IRQ */);
I've put a working build at:
http://www.espruino.com/tmp/espruino_1v85.139_pico_1r3.bin
If you copy that link and paste it into the Web IDE's flasher, it should work fine.
-
• #5
Wow, you're awesome, @Gordon! Unfortunately, http://www.espruino.com/tmp/espruino_1v85.139_pico_1r3.bin doesn't seem to exist (I get a 404).
I can't wait to try it on pins other than B3-B8. :)
-
• #6
Strange... try:
http://www.espruino.com/tmp/espruino_1v85.139_pico_1r3.bin
I just clicked on the link you pasted and it works, but mine doesn't!
If not, just look in http://www.espruino.com/tmp for the file.
-
• #7
There's a weird non-printable character in the URLs above. (To give credit where credit is due, I used https://hexed.it/ to inspect the URLs.)
But, anyway, http://www.espruino.com/tmp/espruino_1v85.139_pico_1r3.bin doesn't seem to work on my Pico. :( The red LED is on when I plug it in after uploading the firmware, and the Web IDE can't connect to it (the Ports list is missing the Pico, even).
Any ideas? Perhaps I flashed it wrong? I can upload a screencast, if that would help.
1 Attachment
-
• #8
I used curl to get it, because I have a CC3000 from the 'old', non-ESP8266 days... and the file came down with 7k... I know something was not right, but did not have time to dig deeper. Now I know...
-
• #9
Damn - sorry - I always forget about this. The Web IDE expects and image that includes the bootloader - and the image I posted didn't.
I've just padded it out as:
http://www.espruino.com/tmp/espruino_1v85.139_pico_1r3_bootloader.bin
Strange about the extra character - I think it's a bug in the forum's syntax highlighting code (IIRC it's a special 'break here' character). I had to change the Web IDE so that it ignored it in pasted code - it obviously doesn't do the same with URLs :)
-
• #11
I just updated it with a new build. Maybe try now, with the same bootloader link.
-
• #12
espruino_1v85.139_pico_1r3_bootloader.bin
successfully flashed this time, yay!I tried almost everything I could think of, including:
- B3-B8
- B3-B7, A8
- B13-B15, A5-A7
Just for the record, what's the proper syntax for
.connect()
:var wlan = require("CC3000").connect(SPI2, A7, A6, A5);
....or....
var wlan = require("CC3000").connect(SPI2, {cs:A7, en:A6, irq:A5});
Thanks so much, @Gordon! :)
- B3-B8
-
• #13
And it works now?
The first one is correct - I've been trying to use the second for new things as it is much more readable, but this particular bit of Espruino still uses the old way
-
• #14
Yeah, works great! I'm using custom pins and everything.
Thank you, you're awesome.
Hi everyone!
I'm trying to use my Pico + CC3000 using non-default pins (not B6-B8).
In failing to do this, I tried just this:
...which hangs!
But this:
...works great! Takes about four seconds.
Am I using the API incorrectly?
Thanks everyone!
P.S. I tried this too:
Also hangs.