-
-
Hello,
I connected a SD card reader module to the Pico. I set it up the following way:
var spi = new SPI();
spi.setup({mosi:B14,miso:B15,sck:B13});
E.connectSDCard(spi, A8);I experience in some situations that I receive "ERROR: Could not open file : DISK_ERR" errors for files that are definitely existing. After receiving the error message I have to set the above mentioned settings again to do subsequent file access.
What can cause this error? How can I handle it, so that my software automatically sets the configuration again when it got lost? I thought it could be a problem with E.unmountSD(), so I removed all unmounts in my code, but that didn't work.
Best,
Tobias
-
-
-
Sure. Here is the output:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v79.19 Copyright 2015 G.Williams >echo(0); Connecting to sim900a module ["ATE0\r\n" =undefined ] "A" <--- "A" ] "ATE0\r\n\r\nOK\r\n" <--- "TE0\r\n\r\nOK\r\n" ["AT+CPIN?\r\n" ] "\r" <--- "\r" ] "\n+CPIN: READY\r\n\r\nOK\r\n" <--- "\n+CPIN: READY\r\n\r\nOK\r\n" ["AT+CGATT?\r\n" ] "\r" <--- "\r" ] "\n+CGATT: 1\r\n\r\nOK\r\n" <--- "\n+CGATT: 1\r\n\r\nOK\r\n" ["AT+CIPSHUT\r\n" ] "\r" <--- "\r" ] "\nSHUT OK\r\n" <--- "\nSHUT OK\r\n" ["AT+CIPSTATUS\r\n" ] "\r" <--- "\r" ] "\nOK\r\n\r\nSTATE: IP INITIAL\r\n" <--- "\nOK\r\n\r\nSTATE: IP INITIAL\r\n" ["AT+CIPMUX=1\r\n" ] "\r" <--- "\r" ] "\nOK\r\n" <--- "\nOK\r\n" ["AT+CIPHEAD=1\r\n" ] "\r" <--- "\r" ] "\nOK\r\n" <--- "\nOK\r\n" ["AT+CSTT=\"pinternet.interkom.de\", \"\", \"\"\r\n" ] "\r" <--- "\r" ] "\nOK\r\n" <--- "\nOK\r\n" ["AT+CIICR\r\n" ] "\r" <--- "\r" ] "\nOK\r\n" <--- "\nOK\r\n" null ["AT+CIFSR\r\n" ] "\r" <--- "\r" ] "\n10.47.223.198\r\n" <--- "\n10.47.223.198\r\n" IP:10.47.223.198 ["AT+CIPSTART=0,\"TCP\",\"http://www.pur3.co.uk\",80\r\n" ] "\r\nOK\r\n" <--- "\r\nOK\r\n" ] "\r\n0, CONNE" <--- "\r\n0, CONNE" ] "0, CONNECT OK\r\n" <--- "CT OK\r\n" ["AT+CIPSEND=0,64\r\n" ] "\r\n> " <--- "\r\n> " ] "\r\n0" <--- "\r\n0" ] "0, SEND OK\r\n" <--- ", SEND OK\r\n" ["AT+CIPSEND=0,34\r\n" ] "\r\n> " <--- "\r\n> " ] "\r\n0, SEN" <--- "\r\n0, SEN" ] "0, SEND OK\r\n" <--- "D OK\r\n" ] "\r\n+RECEIVE" <--- "\r\n+RECEIVE" ] "+RECEIVE,0,289:\r\nHTTP/1.1 200 OK\r\nDate: Tue, 09 Jun 2015 11:07:06" <--- ",0,289:\r\nHTTP/1.1 200 OK\r\nDate: Tue, 09 Jun 2015 11:07:06" ] "+RECEIVE,0,239: GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT" <--- " GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT" ] "+RECEIVE,0,157:\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length:" <--- "\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length:" ] "+RECEIVE,0,86: 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World!\n" <--- " 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World!\n" Response: { "headers": { "Date": "Tue, 09 Jun 2015 11:07:06 GMT", "Server": "Apache/2.2.14 (Ubuntu)", "Last-Modified": "Fri, 15 Nov 2013 15:42:26 GMT", "ETag": "\"c01036-d-4eb390b8a8d18\"", "Accept-Ranges": "bytes", "Content-Length": "13", "Vary": "Accept-Encoding", "Connection": "close", "Content-Type": "text/plain" }, "httpVersion": "P/1.1 200 OK\r\nDate: Tue, 09 Jun 2015 11:07:06 GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length: 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World", "statusCode": "\nHTTP/1.1", "statusMessage": "200 OK\r\nDate: Tue, 09 Jun 2015 11:07:06 GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length: 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World" } --->Hello World ] "!\n\r\n" <--- "\r\n" ] "0, CLOSED\r\n" <--- "0, CLOSED\r\n" >
-
-
-
The apn, username and password depends on the service provider you are using. In the most cases these are the same for all users and you can find it on the support pages of the providers. Here is a list with some apn settings:
http://www.hw-group.com/products/HWg-Ares/HWg-Ares_GSM_APN_en.html
-
-
Thank you. I attached the most recent version of the sim900 lib.
Regarding the problem that Espruino hangs do you think that has something todo with Serial1 as discussed here?
http://forum.espruino.com/conversations/255152/#comment12325361
I experienced that when I first connect the pico to USB and then start the sim900 module the problem doesn't exist. I'll try to set USB.setConsole() in onInit tomorrow and check if that solves the problem.
-
-
Regarding the HTTP Status code: I can see that some of the data is not getting passed correctly to the attributes of the Response-Object. See here:
Response: { "headers": { "Date": "Mon, 08 Jun 2015 12:09:31 GMT", "Server": "Apache/2.2.14 (Ubuntu)", "Last-Modified": "Fri, 15 Nov 2013 15:42:26 GMT", "ETag": "\"c01036-d-4eb390b8a8d18\"", "Accept-Ranges": "bytes", "Content-Length": "13", "Vary": "Accept-Encoding", "Connection": "close", "Content-Type": "text/plain" }, "httpVersion": "P/1.1 200 OK\r\nDate: Mon, 08 Jun 2015 12:09:31 GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length: 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World", "statusCode": "\nHTTP/1.1", "statusMessage": "200 OK\r\nDate: Mon, 08 Jun 2015 12:09:31 GMT\r\nServer: Apache/2.2.14 (Ubuntu)\r\nLast-Modified: Fri, 15 Nov 2013 15:42:26 GMT\r\nETag: \"c01036-d-4eb390b8a8d18\"\r\nAccept-Ranges: bytes\r\nContent-Length: 13\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/plain\r\n\r\nHello World" }
-
I have reproducable problems again with the Pico. [CTRL+C] echo(1) doesn't help here. I just get it working when disconnecting it from USB and from the power source. It happens in the sim900 driver when the method init is getting called.
I currently have the problem very often using other code but I was not able to reproduce it.
This is the output (after that it hangs):
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v79.19 Copyright 2015 G.Williams >echo(0); =undefined Inititialize sim900 module >
As well the Pico sends some weird characters sometimes when connecting it to USB (no init function has been set which could produce that):
Connected >à Ö2|
-
-
-
Thank you very much Gordon!
I already updated the chip and I saw that there are now 4860 JSVars usable. To get it up-to-date I had to remove it from my PCB. Currently I have no solder anymore to get it soldered on the PCB again. As soon I soldered it again to the board, I'll test it with my project again and give you a feedback if everything is working.
-
The entire code of the project is compressed using UglifyJS and loaded from the SD card. I separated the most of the code into JS modules. Would it be possible to create a build without the WizNet driver so that it fits into the 256 kB, so that I can use more RAM? How is it possible that on the regular Espruino which has 32kB RAM I can use more JSVars with the Bigram build than here?
I am a bit frustrated because when I don't find a solution for this problem, my project fails.
-
Hello Gordon,
I read that the Pico has 96 kb of RAM. So I would expect I could use round about 6000 JSVars.
What I can see when I call process.memory() is, that I just can use 3040 JSVars which must be 48kb. This is less than what I could use with the regular Espruino with a Bigram Build. There I have 3250 JSVars.
This is a major problem for me now. I have a highly complex application which was working with the CC3000 module and the Bigram Build on the Espruino near to the RAM limit. I switched to the Pico to have the additional RAM (total 96kb) so that I am able to use a JS-based driver for GPRS. When I now load the driver together with the rest of my application I run out of memory. Is there a possibility to use more than 3040 JSVars on the Pico? Maybe with a special build?
Best,
Tobias
=undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v80 Copyright 2015 G.Williams >process.memory(); ={ "free": 3019, "usage": 21, "total": 3040, "history": 0, "stackEndAddress": 536925180, "flash_start": 134217728, "flash_binary_end": 313548, "flash_code_start": 134234112, "flash_length": 393216 } >
-
Seems to be just a problem with the build you sent me. I had strange problems. Sometimes I got it working by just adding a few white space characters. After removing them it didn't work again. Looked like weird problems with the JS parser.
I can not find a bin file for the most recent commit:
http://www.espruino.com/binaries/git/commits/10464eabd031e6bb8bea1a521cdd1a15fcb94088/What happend here?
-
-
-
It was very complex code with access to the SD card, different libraries I wrote and modules...
I could reproduce it... But for now it is working... The strange thing is, I didn't make any change... I just disconnected the board a few times and reconnected it to USB...
UPDATE: I have the problem again.
I cannot post the code because it is related to my masters thesis therefore I cannot publish it here.
-
-
Everything is working well for the most of the time. Sometimes this error comes up and then I can't do anything with files before I set the SPI settings again. Can it be a problem with the SD card itself?
The wiring seems to be ok for me.