ERROR: Unable to mount SD card : NOT_READY

Posted on
  • I am attempting to load and execute a JS file from the SD card.

    eval(require('fs').readFile("aes.js"));
    

    The aes.js file is loaded to the root of the SD card. That code produces the error:

    ERROR: Unable to mount SD card : NOT_READY

    Eventually, I would like to load the aes.js file to execute:

    var encrypted = CryptoJS.AES.encrypt("Message", "Secret Passphrase");
    
        var decrypted = CryptoJS.AES.decrypt(encrypted, "Secret Passphrase");
    
  • Well, what you're doing should work. Have you used that SD card with Espruino for anything before?

    Could you try re-formatting it, and make sure the format is FAT32...

  • @Gordon, I have used the SD card with the Espruino a couple days ago. I loaded settings from a .js file. I will reformat the card and try again after work.

  • I've seen NOT_READY errors after removing and reinserting the SD card. Sometimes. I've also had 2 micro SD cards fail in the past 2 years, despite not using SD cards much; the one that failed while in an Espruino went over to giving NOT_READY errors.

  • @DrAzzy alright, I will purchase another sdcard just in case.

  • @d0773d Did you ever get AES working? I just tried it with the smallest JS AES code I could find (https://github.com/mdp/gibberish-aes), stripped required parts, minified it, and it ran out of memory expanding Rcon.

    It isn't written for embedded devices, so I might have to port one of the Arduino ones if I can't find something.

  • Looking at that code, it seems to use standard arrays quite heavily. If you could convert it to either use Strings or Uint8Arrays then it might stand more of a chance of working.

  • @thomc No, unfortunately I didn't get AES to work. I have been researching alternative methods for encryption such as communicating over serial to the Intel Edison and have the Edison handle encrypt/decryption.

    I honestly would rather only use the Espruino. As far as porting a library over to javascript is well over my know how. I have stumbled across:http://forum.arduino.cc/index.php?topic=88890.0 maybe that can help you out. Please let me know if you port that over. Supporting all encryption will probably require a lot of ram so maybe just AES 128 will work?

  • A C based AES implementation could be very handy. While a port to JS might be painful, actually using the C code directly would be relatively easy if you were willing to compile your own firmware. The AES code above might work but appears to be designed for 8 bit, whereas maybe a 32 bit one would more simple.

    @Ganehag is also working on a SHA hash for Espruino too, which might be helpful if you don't care about encryption but instead just want to be sure that data is valid.

    Having said that about AES, some people would say that bad security is worse than no security. I'm not sure, but it seems like someone could crack 128 bit AES quite quickly... If they're motivated enough to sniff packets then perhaps the encryption isn't much of an obstacle either... Not to mention the potential pitfalls if you implement your own key exchange and there's a problem.

  • It's not AES but tweetnacl.js, which is a port of the C tweetnacl, which is itself a port of NaCl for embedded systems, has good encryption for embedded systems. I've used the C version of tweetnacl on a Pebble to do encryption/decryption.

  • That's interesting. I will have to look into NaCI security.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ERROR: Unable to mount SD card : NOT_READY

Posted by Avatar for d0773d @d0773d

Actions