Profile cover photo
Profile photo
James Newton
349 followers -
Technical Education, The Scientific Method, Wearable computing, Electronics, Kits, 3D printing, CNC, Stepper Motors and Controllers.
Technical Education, The Scientific Method, Wearable computing, Electronics, Kits, 3D printing, CNC, Stepper Motors and Controllers.

349 followers
About
James's interests
View all
James's posts

Post has shared content
Version 3 of this is becoming quite useful. e.g.
5,11( - _ _ - _ - - _ . ........ .)
starts with clock on pin 5 and data on 11, sends 10010110, gets ack, data, ack, and stops. It returns the data as binary.

and any pin can be input, pulled up, output, high or low, pulses, complex patterns, analog in or out, and some pins will support servos. 
Simple #Arduino script to set pins high, low, input, pull up, or analog and read all or a single pin back via serial IO. Written for the tiny-circuits. com TinyDuino in the end effector of the Dexter robot from
http://www.HDRobotic.com
but generally useful to turn the Arduino into a tool for generating test signals, and reading back results. Not as powerful as the #busPirate, but more flexible in some ways and much easier to operate. Not a replacement for #Firmata as this is intended to be used by a human directly via serial monitor or terminal, not from a program.

Commands:
#? //return binary value of digital pin, and value for analog input if exists
//if # and #, are zero, returns all pins and analog values at once.
#I //set pin # to an input
#P //set pin # to an input with internal pullup
#H //set pin # to a high output
#L //set pin # to a low output
#, //save pin # as the default pin for all commands
#A //set pin # to an analog output with value. Only PWM outputs will respond.
// use with , command e.g. 5,120A will put 120 on pin 5
Commands can be strung together on one line; spaces, tabs, carriage returns and line feeds
are all ignored. If no n is specified, value previously saved by , is used.

Examples:
?
//returns something like: <10000000001111,539,475,425,408,386,376>
// where 10000000001111 shows the binary value of each pin, from 0 to 14. Pin 0 is 1
// 539,475,425,408,386,376 are the values read from each analog channel 0 to 5
1?
//returns something like: <1:1,539> where 1 is the binary value of pin 1 and
//539 is the analog value of channel 1
6?
//returns something like <6:0> which is the value of pin 6 (no analog)
4L 6H 5,120A
//(nothing returned) Drives pin 4 low, pin 6 high and puts a PWM / Analog value of 120 on pin 5
//this also saves pin 5 as the default pin for all commands from now on
240A
//(nothing returned) assuming prior command was 5,120A put 240 out pin 5 as new analog value
?
//assuming 5, has been recieved before, returns just the value of pin 5 and analog 5
0,
//(nothing returned) clears saved pin, ? now returns all pins.

https://gist.github.com/JamesNewton/8b994528ff3ce69e60bbb67c40954cd2

Simple #Arduino script to set pins high, low, input, pull up, or analog and read all or a single pin back via serial IO. Written for the tiny-circuits. com TinyDuino in the end effector of the Dexter robot from
http://www.HDRobotic.com
but generally useful to turn the Arduino into a tool for generating test signals, and reading back results. Not as powerful as the #busPirate, but more flexible in some ways and much easier to operate. Not a replacement for #Firmata as this is intended to be used by a human directly via serial monitor or terminal, not from a program.

Commands:
#? //return binary value of digital pin, and value for analog input if exists
//if # and #, are zero, returns all pins and analog values at once.
#I //set pin # to an input
#P //set pin # to an input with internal pullup
#H //set pin # to a high output
#L //set pin # to a low output
#, //save pin # as the default pin for all commands
#A //set pin # to an analog output with value. Only PWM outputs will respond.
// use with , command e.g. 5,120A will put 120 on pin 5
Commands can be strung together on one line; spaces, tabs, carriage returns and line feeds
are all ignored. If no n is specified, value previously saved by , is used.

Examples:
?
//returns something like: <10000000001111,539,475,425,408,386,376>
// where 10000000001111 shows the binary value of each pin, from 0 to 14. Pin 0 is 1
// 539,475,425,408,386,376 are the values read from each analog channel 0 to 5
1?
//returns something like: <1:1,539> where 1 is the binary value of pin 1 and
//539 is the analog value of channel 1
6?
//returns something like <6:0> which is the value of pin 6 (no analog)
4L 6H 5,120A
//(nothing returned) Drives pin 4 low, pin 6 high and puts a PWM / Analog value of 120 on pin 5
//this also saves pin 5 as the default pin for all commands from now on
240A
//(nothing returned) assuming prior command was 5,120A put 240 out pin 5 as new analog value
?
//assuming 5, has been recieved before, returns just the value of pin 5 and analog 5
0,
//(nothing returned) clears saved pin, ? now returns all pins.

https://gist.github.com/JamesNewton/8b994528ff3ce69e60bbb67c40954cd2

Post has attachment
Using the MassMind BOB PCB as a cheap LCD front panel for the Arduino. Details and code at:
http://techref.massmind.org/techref/arduino-bob-panel.htm

Post has attachment

Post has attachment
So for anyone trying to get things to work in the google universe, this blog post pretty much says it all. In summary? Google apps are free, but all that backend / API / scripting stuff is just buggy as hell.

Now, google docs, sheets, drive, etc... are wonderful! Rock solid. I've never lost a byte of data in years and years. But try to app script something, and hold onto your hair, because you will be pulling it out.

Comon G! Get it together!

https://wp.josh.com/2014/06/04/using-google-spreadsheets-for-logging-sensor-data/

Post has shared content
Any of you guys know SQL guru's? 
So my attempt to provide an ultra low cost IOT serial to Web adapter continues. I've been able to accomplish streaming very large files (73K lines, 2MB) thru a $5 ESP-8266 device to a $10 CNC motion controller, but growing the working hardware into a general purpose solution is probably beyond me just because of the the server security issues. e.g. how to setup an SQL server so that it can bulk import a file to a table without giving the public user so many rights that they can also just hack the server.

HELP!? Anyone who knows SQL security, even a little would be a lifesaver. I'd be willing to pay much less than you are worth for the assistance! Or be eternally grateful.

This is where I am now, and it describes the specific problems.
http://techref.massmind.org/techref/language/sql/tsqlimportsimpletext.htm

And this is why I'm trying to do this:
http://techref.massmind.org/techref/ESP8266/WebSerial.htm


Post has shared content
Any of you guys know SQL gurus?
So my attempt to provide an ultra low cost IOT serial to Web adapter continues. I've been able to accomplish streaming very large files (73K lines, 2MB) thru a $5 ESP-8266 device to a $10 CNC motion controller, but growing the working hardware into a general purpose solution is probably beyond me just because of the the server security issues. e.g. how to setup an SQL server so that it can bulk import a file to a table without giving the public user so many rights that they can also just hack the server.

HELP!? Anyone who knows SQL security, even a little would be a lifesaver. I'd be willing to pay much less than you are worth for the assistance! Or be eternally grateful.

This is where I am now, and it describes the specific problems.
http://techref.massmind.org/techref/language/sql/tsqlimportsimpletext.htm

And this is why I'm trying to do this:
http://techref.massmind.org/techref/ESP8266/WebSerial.htm


Post has attachment
So my attempt to provide an ultra low cost IOT serial to Web adapter continues. I've been able to accomplish streaming very large files (73K lines, 2MB) thru a $5 ESP-8266 device to a $10 CNC motion controller, but growing the working hardware into a general purpose solution is probably beyond me just because of the the server security issues. e.g. how to setup an SQL server so that it can bulk import a file to a table without giving the public user so many rights that they can also just hack the server.

HELP!? Anyone who knows SQL security, even a little would be a lifesaver. I'd be willing to pay much less than you are worth for the assistance! Or be eternally grateful.

This is where I am now, and it describes the specific problems.
http://techref.massmind.org/techref/language/sql/tsqlimportsimpletext.htm

And this is why I'm trying to do this:
http://techref.massmind.org/techref/ESP8266/WebSerial.htm


Post has attachment
Do I know anyone who has uploaded a text file or CSV (with only one field) to a cloud database server? SQL or mongo or the google datastore or anything like that?

The goal:
1. Upload the file (as automatically as possible) and parse it into lines in the database. Like CSV data with a field separator that won't appear in the file, so each line is one field. The file might be several megabytes.

2. Use a standard REST API to get line X, and Y following lines. E.g.
techref.massmind.org/techref/getline.asp?line=2&lines=3
returns the 2nd, 3rd, and 4th lines of the file. Response time needs to be quick. Yes, that currently works, but I don't wanna host it myself.

Especially if it was data from a file sharing service like google drive or dropbox where you can just dump the file in a local folder and have it automatically sync with the cloud.

But just any experience with loading ASCII data into the cloud would be a good start. I just need to know it works before I invest a bunch more time in trying different services only to find out they are stupid, broken, or lame. Like google drive. And dropbox scripting.

+Patrick Staight, +Kevin Herrera, +Rob Burkhead, anyone? Any suggestions for where to ask?

If no one has, I'm going to try spinning up an app engine and google cloud datastore instance.

There is a need for an open source service that feeds bite sized chunks of very large data files to little IOT devices. E.g. anything that takes g-code.

If I wanted to do this on my own server, I'd just load the text file into a table in my SQL database with one nvarchar(255) field, write a web API that takes a filename and line number and returns that line from the file, and be done with it. You tell the IOT device what filename and it starts with line 1, automatically requesting the next as it goes. Maybe it can request the next n lines at once, if it has a larger buffer just to speed things up.

But I don't wanna do it with my server, I wanna do it with a file sharing service, so that other people can do it without being dependant on my machine, and without beating my ISP to death. And have the convenience of the file sharing service.

The ideal flow would be:

1. User drops file into google drive / dropbox sub folder on their machine

2. After sync to cloud, something parses the file into chunks the IOT device can manage, e.g. lines in SQL table, bunch of smaller files in sub sub directory, etc... it would be nice if an app script triggered automatically when a new file arrives in that folder in the cloud.

3. IOT device gets told where to look, and starts loading bites of data and processing it. E.g. printing, cutting, burning g-code. It would be nice if a notification was available somewhere that this was complete. E.g. a web app that says "here are new file bites waiting for you to eat" when the IOT device checks in.

So moving the data from the file sharing service into the bite sizer seems to be my current sticking point. Has anyone worked with a cloud host that can grab files from e.g. google drive or dropbox? Can google cloud services do that? Or do you have to upload to the google cloud storage service?

From what I've tried so far, Google Drive App Scripts ain't going to cut it. They have so many security restrictions and weird bugs and limits that there is just no way. But maybe combined with Google Cloud services?

Dropbox has an API, and a scripting service, but at first glance, it's only good for things like copying entire files.

Worse comes to worse, I'll spin up a Google Compute Engine server... document the process and then share it. Or maybe I'll try Google App Engine... I haven't done that yet.

Anyone? Anyone? Buler?
Wait while more posts are being loaded