-
I have Windows 7 installed and I originally tried to install the USB CDC drivers by downloading and install this: http://www.st.com/web/en/catalog/tools/PF257938
After installing the CDC drivers I unplugged the Espruino from the USB port and plugged in the Espruino back into the USB port. The Device Manager failed to find the Espruino even though I installed the CDC drivers. I then, completely removed the CDC drivers by using the installer. I then decided to using Windows Update to find and install the CDC drivers. A couple minutes later the installation of the CDC drivers successfully installed and now the Device Manager successfully finds the CDC driver.
However, multiple new issues arose. The Web IDE has a hard time connecting to the Espruino. Most of the time when I connect to the Espruino in the console I would receive Connect and nothing more instead of the console outputting the double =undefined. When that happens, I noticed when I click the upload code button I would get the upload status bar but the code doesn't actually upload.
To trouble shoot these issues, I tried multiple usb cables and usb ports and I would still get the issues stated above. I then went into the Device Manager and uninstalled the CDC driver, removed the Espruino from the USB cable and plugged the Espruino back in. I now can successfully connect to the Espruino and upload code. My test code outputs the array values to the console a few times and then stops responding. I have absolutely no idea why these issues happen on Windows. I can't seem to reproduce the issues on my Ubuntu machine.
Complete test code:
I2C1.setup({scl:b6, sda:b7}); setInterval(function (e) { var tempQuery = 0; I2C1.writeTo(99, "T,19.5"); setTimeout(function (e) { I2C1.writeTo(99, "T,?"); setTimeout(function (e) { tempQuery = I2C1.readFrom(99, 7); console.log(tempQuery); }, 300 ); }, 300 ); }, 5000);
-
-
@DrAzzy I edited my original post with all the code. It's really messy and eventually I will split my code up into separate files to later include them.
@Gordon I checked what's in bot by doing:
setInterval(function (e) { //bot.getPhValue(90.5); console.log(bot); }, 3000);
I receive what looks like an empty object:
{ }
-
I'm not sure what the terminology is called.... I am trying to instantiate an object within another object.. I am getting these errors:
Uncaught Error: Field or method does not already exist, and can't
create it on undefined at line 2 col 10
this.ph.updateResTemp(tempCompensation);^ in function "getPhValue" called from line 2 col 22 bot.getPhValue(90.5); ^
Code:
I2C1.setup({scl:b6, sda:b7}); Serial4.setup(9600, {tx:C10,rx:C11}); function s7s (theAddress) { this.address = theAddress; this.displayTable = { "Clear" : 0x76, "dp" : { "cmd" : 0x77, "location" : [ 0b00000001, //Digit 0 0b00000010, //Digit 1 0b00000100, //Digit 2 0b00001000 //Digit 3 ] } }; } s7s.prototype.writeValueToDisplay = function () { var toChar = ""; var a = this.address; var clrCMD = this.displayTable.Clear; //Display clear command var dpCMD = this.displayTable.dp.cmd; //Decimal point command var dpLocation = this.phDisplay.displayTable.dp.location; //Decimal point location map I2C1.writeTo(a, clr); //Clear display }; function Sensor (theType, theAddress) { this.type = theType; //i.e. PH this.address = theAddress; //i2c Address this.sensorResult = 0; //Store sensor result this.cmdTable = { "Calibrate" : { //List of Calibration commands and timeout value. "clear" : { "cmd" : "Cal,Clear", "wait" : 300 }, "mid" : { "cmd" : "Cal,mid,7.00", "wait" : 1300 }, "low" : { "cmd" : "Cal,low,4.00", "wait" : 1300 }, "high" : { "cmd" : "Cal,high,10.00", "wait" : 1300 }, "query" : { "cmd" : "Cal,?", "wait" : 300 } }, "Information" : { //Device Information }, "LED" : { //Enable / Disable or Query the LEDs "L0" : { "cmd" : "L,0", "wait" : 300 }, "L1" : { "cmd" : "L,1", "wait" : 300 }, "L?" : { "cmd" : "L,?", "wait" : 300 } }, "Reading" : { //Takes a single reading "R" : { "cmd" : "R", "wait" : 1000 } //Takes a single temperature compensated reading }, "Serial" : { //Switch back to UART mode }, "Sleep" : { //Enter low power sleep mode }, "Status" : { //Retrieve status information }, "Temperature" : { //Set or Query the temperature compensation "T" : { "cmd" : "T,19.5", "wait" : 300 }, //Where the temperature is any value; floating point, or int, in ASCII form "T?" : { "cmd" : "T,?", "wait" : 300 } //Query the set temerature }, "Factory" : { //Factory reset }, }; } Sensor.prototype.getSensorType = function () { return this.type; //Get Sensor type }; Sensor.prototype.getSensorAddress = function () { return this.address; //Get Sensor address }; Sensor.prototype.getSensorReading = function() { var a = this.address; var d = I2C1.readFrom(a, 7); return d; }; Sensor.prototype.getSensorResult = function () { var a = this.address; var c = this.cmdTable.Reading.R.cmd; var w = this.cmdTable.Reading.R.wait; var that = this; I2C1.writeTo(a, c); setTimeout(function (e) { callback(that.getSensorReading()); }, w); }; Sensor.prototype.storeSensorResult = function () { }; Sensor.prototype.updateResTemp = function (temp) { var a = this.getSensorAddress(); var c = this.cmdTable.Temperature.T.cmd; var w = this.cmdTable.Reading.R.wait; var that = this; Serial4.print(a + " " + c + "\r\n"); I2C1.writeTo(a, c); setTimeout(function (e) { that.getSensorReading(); }, w); }; function processData () { //Sensor Objects var ph = new Sensor("ph", 0x63); var ec = new Sensor("ec", 0x64); //Sensor Displays var phDisplay = new s7s(0x71); var ecDisplay = new s7s(0x72); } processData.prototype.getResTempValue = function () { }; processData.prototype.getRoomTempValue = function () { }; processData.prototype.getRoomHuminityValue = function () { }; processData.prototype.getPhValue = function (tempCompensation) { this.ph.updateResTemp(tempCompensation); }; processData.prototype.getEcValue = function (tempCompensation) { }; Serial4.on('data', function (data) { Serial4.print(data); var edisonData = data; Serial4.print("Edison sent: " + edisonData); }); var bot = new processData(); setInterval(function (e) { bot.getPhValue(90.5); }, 3000);
-
@Gordon how does one go about purchasing shims or any of the Pico Adapter boards?
-
-
@Gordon I forgot the () :/ The code now works
-
@Gordon Its been 4 months since I did anything with my project. My computer crashed and I lost all of my code referring to this post. I copied and pasted my code from this post and tried to implement your suggestions again.
I am trying to pass in the value of this.address and execute the functions instead of returning the function it self.
However, as you explained, I am returning the function itself rather than executing it and getting the result. For example, in
Sensor.prototype.updateResTemp
console.log(a + " " + c);
returns:
function () {
return this.address; //Get Sensor address
} T,19.5Code from this thread and memory:
I2C1.setup({scl:b6, sda:b7}); function Sensor (theType, theAddress) { this.type = theType; //i.e. PH this.address = theAddress; //i2c Address this.sensorResult = 0; //Store sensor result this.cmdTable = { "Calibrate" : { //List of Calibration commands and timeout value. "clear" : { "cmd" : "Cal,Clear", "wait" : 300 }, "mid" : { "cmd" : "Cal,mid,7.00", "wait" : 1300 }, "low" : { "cmd" : "Cal,low,4.00", "wait" : 1300 }, "high" : { "cmd" : "Cal,high,10.00", "wait" : 1300 }, "query" : { "cmd" : "Cal,?", "wait" : 300 } }, "Information" : { //Device Information }, "LED" : { //Enable / Disable or Query the LEDs "L0" : { "cmd" : "L,0", "wait" : 300 }, "L1" : { "cmd" : "L,1", "wait" : 300 }, "L?" : { "cmd" : "L,?", "wait" : 300 } }, "Reading" : { //Takes a single reading "R" : { "cmd" : "R", "wait" : 1000 } //Takes a single temperature compensated reading }, "Serial" : { //Switch back to UART mode }, "Sleep" : { //Enter low power sleep mode }, "Status" : { //Retrieve status information }, "Temperature" : { //Set or Query the temperature compensation "T" : { "cmd" : "T,19.5", "wait" : 300 }, //Where the temperature is any value; floating point, or int, in ASCII form "T?" : { "cmd" : "T,?", "wait" : 300 } //Query the set temerature }, "Factory" : { //Factory reset }, }; } Sensor.prototype.getSensorType = function () { return this.type; //Get Sensor type }; Sensor.prototype.getSensorAddress = function () { return this.address; //Get Sensor address }; Sensor.prototype.getSensorReading = function() { var a = this.getSensorAddress; var d = I2C1.readFrom(a, 7); return d; }; Sensor.prototype.getSensorResult = function () { var a = this.address; var c = this.cmdTable.Reading.R.cmd; var w = this.cmdTable.Reading.R.wait; var that = this; //I2C1.writeTo(a, c); setTimeout(function (e) { callback(that.getSensorReading()); }, w); }; Sensor.prototype.storeSensorResult = function () { }; Sensor.prototype.updateResTemp = function (temp) { var a = this.getSensorAddress; var c = this.cmdTable.Temperature.T.cmd; var w = this.cmdTable.Reading.R.wait; var that = this; console.log(a + " " + c); //I2C1.writeTo(99, "T,19.5"); I2C1.writeTo(a, c); setTimeout(function (e) { that.getSensorReading(); }, w); }; var ph = new Sensor("ph", 0x63); ph.updateResTemp(90.5);
-
I am looking to purchase a bench top power supply and oscilloscope. I dont know much about these tools so I don't have a price range. Can anyone recommend types, brands and a possible price for low end, mid range and top of the line? Also, maybe let me know which brands to stay away from?
@Gordon I was also wondering if it would be possible to start another forum section about general electronics that don't generally fall under the "Espruino" category?
-
@LawrenceG good to know :-) Thanks!
-
@Gordon If you don't mind me asking, how much does it cost you per month/year to keep the forum of the espruino website up and running?
-
@Gordon I was thinking about encryption for both ethernet and wifi. I am trying to take the route with the least resistance, so Wifi might be the better option for me to start with and see what kind of results I find.
-
@Gordon I receiving the error while attempting to visit forum.espruino.com. The error looked like the Apache error, but please don't quote me on that because I am not 100% sure.
-
I ordered a few whisker (LoRa) modules from http://www.d6labs.com and waiting for them to be shipped. I am not sure when the shipping date will be, but I am super psyched to play with them and actually see how far the "actual" distance I can get with line of sight vs going through obstacles.
-
-
-
Ya, I thought about that. Maybe make an Ecryption breakout board designated only for crypto. For example: https://www.sparkfun.com/products/12773 The CryptoCape is for the beagle bone black. The Cape is rather large and I would most likely need a smaller breakout board. I've been thinking about a crypto project for a while now, but I haven't had the time to sit down and research the subject in depth. For all I know, there already might be a crypto project out there like the cryptocape.
-
SHA-224/256/384/512 will work for the signature :). Now, it depends on whether AES128 or 256 can work which I guess will depend on memory consumption. I was able to implement encryption on a LPC1768 mcu which only has 32KB RAM, 512KB FLASH. The Espruino board has RAM 48 kBytes, Flash 256 kBytes
The Pico has 384kb flash, 96kb RAM. So, perhaps the Pico will be better suited for encryption? -
-
I am on a mission to some how impliment aes128/256 and HMAC on the Espruino. There has to be a way to implement encryption. @Gordon I know you mentioned that it might be possible to impliment encryption by custom compiling Firmware. I started to search Google for away to add encryption and stumbled upon this guide: http://hobbymc.blogspot.com/2011/02/stm32-discovery-porting-polar-ssl.html?m=1 I have never played around with the Espruino firmware and was wondering what tools and software I will need to possible attempt what is explained in the guide? I do know the guide explains what tools are needed, but I am not sure if I will need different tools or what? Also is there a tutorial on the website for custom compilation?
-
@Gordon do you take into account that there possibly might be some defective boards manufactured; and does the manufacturer refund the amount of defective boards or are there more boards manufactured to make up for the possible loss?
-
-
I started my microprocessor and programming journey using the parallax basic board about 10 years ago and gradually moved myself to different microprocessor 'platforms'. I.e. Arduino Mega, mBed, espruino and most recently, the GHIElectronics Raptor which can be programmed in VB and C# using the Microsoft .net Micro Framework. Using all these frameworks helped me to learn basic, C, C++, C# and Javascript. Out of all those microprocessor frameworks I seem to gravitate more towards the Espruino, why? Well, for the simple fact that It is so freaking easy to get a project up and running and finished within 2 to 3 days. Eventbased programming such as JS makes better sense to me. Also, the Espruino community is awesome and most questions do not go unanswered. I cannot wait for the Pico to be released and what the future holds for the Espruino :)
-
I stumbled across:http://www.cl.cam.ac.uk/~sps32/mcu_lock.html it was an interesting read. Most of the topic was way over my head, but none-the-less the topic is still interesting.
What I gathered is some of the attacks can be implemented with little money which Is interesting and makes me wonder how much money and time microcontroller companies actually put into securing their chips. It's probably not worth investing much time or money for the hobby market; however, I gather finances and time is probably well invested for military and the health market.
@Gordon I tried pressing the up and down arrows; however, sometimes the IDE is completely unresponsive.
I tried the 'press rst button then immediately press btn1(hold for 2 seconds) then release' The IDE seems to be responding as expected now. Putty seems to always connect even when the IDE locks up. I would send an arbitrary character to Putty and Espruino would respond back with '=undefined'. So, i'm assuming the issue lies primarily in the way Chrome handles serial connections.