-
That's an amazing amount of info Gordon thank you. I'm going to look around what I can and hopefully help.
From reading the page I got the impression I still should be able to use the usb to program it. I tried the Should I start a new thread for this?
I've been having trouble connecting to the microbit over USB once espruino is uploaded. I can see "espruino MICROBIT" listed in bluetooth on my phone. chrome on there can't connect to it though. I checked enable-web-bluetooth is enabled.
Just tried the 1v85 espruino_1v85_microbit.hex from the downloads page zip and also espruino_1v85.63_microbit.hex from the master. Can see them on my phone but can't connect over usb. Chrome IDE normally and run as admin. unplugged/plugged in the bit too.
-
Hey, I'm trying to get into a bit of bluetooth LE. Whilst I've got a microbit with me I want to have it send out a value from an analog pin over bluetooth for anything to pick up. The part I'm confused about is I can't find anything the references using the microbits bluetooth at all.
The espruino webIDE is the only thing I've seen use it. I can't find anything on the microbit.co.uk/app tools that reference bluetooth. I thought about looking at micropython but apparently they'll never do it;
http://microbit-micropython.readthedocs.org/en/latest/ble.html
Perhaps I'm misunderstanding how BLE is supposed to work. Next I'm going to look at how the Web-IDE from NPM is talking to bluetooth for a bit of an example.
-
Alas my deadline has come. I suspect it's some grounding problem when I'm not on my laptop on charge. I don't know enough electronics yet. I've yet to look at the SD source code to try and find a more helpful error message.
Thanks for your help guys. I'll keep working on it and try to have it ready for another time.
-
-
I put in a new SD card low and behold it worked again. So I got quite excited soldered it up and tested it again and it was still working great.
Thought right nows the time for the battery. Disconnected from the PC I put in the 4x1.2v 1800mAH AA pack and the leds came on for things. Stopped it and went back on the PC connection without battery and now I'm back to
ERROR: Unable to mount SD card : NOT_READY
Very perplexing. I can't read/write to it at all now, tried formatting it and reflashing the espruino. PC read and writes fine.
-
There's an
unmountSD
function hereAs for how best to use this, I don't know. I can't see a problem with mounting and unmounting all the time.
-
-
No I'm still stuck with
ERROR: Unable to mount SD card : NOT_READY
Here's my wiring
Here the code;var fs = require('fs'); // Wire up up MOSI, MISO, SCK and CS pins function onInit(){ SPI1.setup({mosi:B5, miso:B4, sck:B3}); E.connectSDCard(SPI1, A8 /*CS*/); } var text = "Hello World!\r\n"; function saveToFile(){ console.log('Append'); fs.appendFileSync('testing.txt', "\tTest line\r\n"); } //setInterval(saveToFile, 2000);
Here's how it executes;
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v77 Copyright 2015 G.Williams >echo(0); =undefined >save() =undefined Erasing Flash...... Programming 48640 Bytes................................................... Checking... Done! Running onInit()... >fs.readdir() ERROR: Unable to mount SD card : NOT_READY =undefined
I know the GPS is unplugged there by the way. I had it logging the GPS. I had it writing a like to a file. Now together I can't write to the SD and this first SD test isn't running.
I reflashed the pico too. same thing.
-
-
I'm a bit shocked how easy that was. So testament to Gordon there excellent work. Took a bit of figuring which pins my board meant by DO,DI and CLK but not hard.
I can't seem to write a line to the card once per second (2 seconds is fine) so I'm going to try appending a list in memory and flushing the list every few seconds. Hopefully it will sequentially write quick enough once it's started.
As this is a power thread
setInterval(function(){ console.log('Append'); fs.appendFileSync('testing.txt', "\tTest line\r\n"); }, 2000);
Sits at 29.6mA and blips to ~32mA to write.
-
Yeh my bad, I've been skipping around the references pages so much. it's in the pico bullet pionts
On-board 3.3v 250mA voltage regulator, accepts voltages from 3.5v to 16v
The regulator being one of these http://html.alldatasheet.com/html-pdf/74620/MICREL/MIC5205/181/1/MIC5205.html as noted on the larger board power diagram.
I'm a bit paranoid with power. I've quite a few memories of plugging stuff in and it never working again. Same feeling you get when flashing firmware.
-
-
-
Thanks Gordon, Yes that's the GPS attached too. I had it on for about 10 minutes and it isn't dropping. But last time I watched it it's quite happy to find more and more satellites. I don't actually have a problem with it trying to get more accurate location data.
The datasheet does say it has some 40mA or lower after about 12 minutes of tracking. I will test this tonight.
Something I couldn't work out about the SD adapters (I didn't look for long) is some have about 15 pins and others 7. Do some boards give a nice SPI interface and others break out the the pin such that I'd have to address everything myself/a fs driver.
As I understand it SD and is surface mount type is just a very basic chip that lets you address the flash directly, unlike fully driven pen drives or SSDs.
-
-
Hope fully this SD breakout will arrive in time and I can wire it up to the Pico.
I put my meter on the USB from my PC to the espruin and it's pulling a steady 110mA while blipping the LED and logging to the serial. I think I'll order a 3000mAh battery I've seen for a couple of quid more than the 1300mAH one that would have nicely fit in the case. Just for some peace of mind.
With some work on power management I bet this could get really efficient.
-
Where is the gps module source code by the way? Or even the complete api reference for it I can't find a page. If there isn't I'll help write one.
I've got this giving me data now. Yes I have the RX/RX pins matching not crossing silly me. Just getting lat,lon,fix,satellites and altitude now and I see the chip could give me a lot more.
It did indeed take ages to receive a signal. There's a nice green LED on the GPS module that flashed when it ticks and has a signal fix.
-
-
Ok I'm using the right side. Maybe my serial console is set up wrong, the gps is flashing merrily away but my
gps.on('data'...
or.connect
console.logs aren't printing anything.If I just test Serial2 I can a pin can't RX but that's because it's not hooked up. Serial1 doesn't leave any errors. Just no output.
console.log('init'); // GPS Setup Serial1.setup(9600, {tx: B6, rx: B7}); var gps = require('GPS').connect(Serial1, function(data){ console.log('Connected'); console.log(data); }); gps.on('data', function(data){ console.log(data); });
outut
> =undefined >reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v77 Copyright 2015 G.Williams >echo(0); init =undefined >
Oh and I've waited a while and the GPS flashes green every second.
-
-
I thought the data event from the GPS would wake up the pico if it was over 1.5 seconds. From what you've said I'll need to make sure the pico is awake on time. In that case and considering what you've said about power I might leave using sleep for a v2 of this. I'm not seeing how I can use a
setWatch
for the serial data.I would be worried about rounding errors in the timers, what's the resolution to the clock? I know IE was famous for only going down to 15.6ms
-
So I went and read setDeepSleep and I'm thinking the following;
I need 2 things;
- GPS coords + time periodically.
- GPS Coords + time on Button press, up to 30/second very briefly.
If I log coords every 2 seconds that will let the pico sleep the most and keep a lot of tracking. Obviously up at 30 logs per second I can just cache the GPS coords and have them change as the board can send me location updates. I don't need that to exactly correlate. I assume the GPS will have a large inaccuracy anyway.
Since time was an issue I've just bought the GPS unit in the docs so the Ublox NEO6MV2[pdf]
I was assume worse case 250mA as that's is what the pico transformer says it maxes out. As you can imagine sizing a battery was getting concerting. 40mA is good to hear I know peripherals will add to that.
Can the pico sleep and leave the GPS unit logging away as it is clearly not going to wake up and get a signal in the time I'm talking about. Will I need to wire power to that directly to keep it on or best just to forget about sleeping the pico?
I'll trade you all your help for a blog post on how this goes.
- GPS coords + time periodically.
-
-
Hi, I'm trying to knock out a project with my new pico for May. I need to log GPS co-ordinates for about 9 hours for 3 days. I can charge between that. Then offload all this data to a pc.
I've been reading some docs and I think I'll have to write this to an SD card. Would another option be to use a typed array in RAM and use save() every now and then so I don't have to panic about losing power and all the data?
I see the sleep current draw advertised but what's the peak power so I can make a worst case estimate to size the battery I'm buying (factoring in the GPS unit naturally). I assume the pico will sleep as best it can for me? I'm used to the arduino and I'd have to program in the sleep calls.
Is there any way to put a female USB-A on a pendrive and get the pico to write to that? Just trying to get out of doing the SD card bit of I can.
Yes it was the serial port driver. Wasnt expecting another driver after using arduinos and things. (Win 10 x64)
I'm just working on trying to find the thing from my phone now the web Bluetooth api seems a bit restrictive.
Doesn't your example need two pipes by the way?