Go to advanced search

by woodystanford
Wed Mar 15, 2017 2:57 am
Forum: C/C++
Topic: [SOLVED] Non Blocking getchar()? [SOLVED]
Replies: 102
Views: 20208

Re: Non Blocking getchar()?

This is what Stanford says: What you are asking for is a traditional puzzle/paradox in UNIX for decades now that seems infuratingly simple due to (a la what the other poster said) it being available on every personal computer like BASIC's INKEY except for UN*X. I attribute this (a guess) to the unde...
by woodystanford
Wed Mar 15, 2017 1:49 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Re: Simple Relay Circuit

Ok rather than retype some stuff, here is a link to how to breadboard and do a DIY PCB. http://1.bp.blogspot.com/-f7BgyBdbnmM/TbZUDr3aBCI/AAAAAAAAAeo/ybAVKk8b0sM/s400/H2O-timer-PCB-boys-room.png ***not the board we are working on*** http://beagleboard.org/discuss?place=msg%2Fbeagleboard%2FuZv7Ex9Ew_...
by woodystanford
Wed Mar 15, 2017 1:39 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Re: Simple Relay Circuit

OK here is a good SSR (checked the datasheet and everything) as it has a led *cough*forward* voltage of around 2V but its got a really strong 1A output. Also make sure you aren't getting End of Life parts or parts that aren't in stock (doing this will hold up your order). Here is the part on Mouser....
by woodystanford
Wed Mar 15, 2017 1:09 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Re: Simple Relay Circuit

OK, (to prempt any questions) why aren't you using a transistor in switching mode where the SSR is. The answer is simple: transistors SUCK! The reason why your grandfather is so crazy is because of transistors. No one really knows how they work (except for a bunch of simultaneous equations). Scary h...
by woodystanford
Wed Mar 15, 2017 1:06 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Re: Simple Relay Circuit

Ok you SSR will look something like this. You can also use an optoisolator but remember that the current only flows in one direction on an optoisolator so you have to line up the output phototransistor correctly. https://woodystanford.files.wordpress.com/2016/10/dip_chip_6.jpg You can also get them ...
by woodystanford
Wed Mar 15, 2017 12:55 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Re: Simple Relay Circuit

OK, here is a schematic of that relay circuit I was talking about. https://woodystanford.files.wordpress.com/2016/10/relay_schematic1.png So get the datasheets for the parts at mouser or digikey and check the matching on the voltage and current OR you can be lazy and just wait for me to put the info...
by woodystanford
Wed Mar 15, 2017 12:05 am
Forum: Automation, sensing and robotics
Topic: Simple Relay Circuit
Replies: 13
Views: 4687

Simple Relay Circuit

Let's cover a simple relay circuit that can be used with the Pi. The first thing we do is figure it out conceptually, ok? Now you can only draw 50ma at +3.3V off of a Pi GPIO pin, so what you have to do is 2 or 3-stage it. What you do is you use a SSR also known as a "solid-state relay". I'm not tal...
by woodystanford
Tue Mar 14, 2017 10:58 pm
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

Actually I don't...still saving my pennies for one. Aren't they the same? *innocent look* A pi is much cheaper than a beaglebone. Yeah I found that out when I got a PI Zero W off of Ebay for like $25 (shipping included). Hoping to play with that soon as it hasn't come in yet. addendum: Just came in...
by woodystanford
Tue Mar 14, 2017 10:57 pm
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

OK, here is some python code for writing a web page to the HTDOC directory of the MM web server. import sys import time ################################## # # Web Server Test Code for Python # # All the program does is write a file # to a HTDOCS directory in html format. # # Compile and run the MM H...
by woodystanford
Tue Mar 14, 2017 10:37 pm
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

OP what you are describing is NOT an embedded web server ! My services on RPi are deployed as a single binary executable plus a few libraries. You start it up and point your browser at it and it renders a HTML interface. There are no folders, no HTML pages and no configuration, unless you want it t...
by woodystanford
Fri Mar 10, 2017 6:56 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

I will try to get some more python examples up here, but the current one will communicate with daemon1 and allow you to perform read and writes to and from the trivial database example. By adding FTP and HTTP support in the wrapper style you will have a solid, TRADITIONAL, Iot framework with which t...
by woodystanford
Fri Mar 10, 2017 6:13 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

Thank you paeryn, Peter and jahboater. I have to remember that there are a lot of people just coming to the thread, but I would advise any one casually dipping into the thread to please be respectful as one of the previous mods has said. There are some esoteric issues like forking(), advanced server...
by woodystanford
Fri Mar 10, 2017 6:05 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, here is the MAGIC piece of code, that if you forget everything else, REMEMBER THIS: if ((ppid=fork())==0) { printf("Child process\n"); execlp("bash","bash","./ecurl.sh","",NULL); return; //terminates child process } //does this block? YES! // printf("Parent process %d\n",ppid); wait(&status); h...
by woodystanford
Fri Mar 10, 2017 6:05 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

...OK, I've thought about this a little more and there are some things bothering me about some of the assumptions in these two posts. So what you are saying is that I can replace an explicit fork operation with a wait() by a call to system(). This is genius. We have some people here who claim to hav...
by woodystanford
Thu Mar 09, 2017 6:01 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, here is the MAGIC piece of code, that if you forget everything else, REMEMBER THIS: if ((ppid=fork())==0) { printf("Child process\n"); execlp("bash","bash","./ecurl.sh","",NULL); return; //terminates child process } //does this block? YES! // printf("Parent process %d\n",ppid); wait(&status);
by woodystanford
Thu Mar 09, 2017 5:16 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, I'm finally there. You have a complete (though rudimentary) IoT framework, ANSI/POSIX-compliant. WILL run with a little tweaking on any UNIX SBC or host. FTP capability: http://beagleboard.org/discuss?place=msg%2Fbeagleboard%2FUx9FBfohkSE%2Ft2mZORiMAwAJ using "in-line" CURL...faster to code than...
by woodystanford
Thu Mar 09, 2017 3:00 pm
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

You keep mentioning the Beagleboard in all your posts. Have you tried any of this stuff on a Pi? Have you even got a Pi? (Throws peanuts from the gallery) Actually I don't...still saving my pennies for one. Aren't they the same? *innocent look* But seriously, I figure they are both POSIX-compliant ...
by woodystanford
Thu Mar 09, 2017 4:57 am
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

Strapping components together IoT style.

Image
by woodystanford
Thu Mar 09, 2017 3:09 am
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

OK, I got this working good on my Beagleboard, so check out:

http://beagleboard.org/discuss?place=ms ... vIva5kAwAJ

For instructions: the build instructions are GOOD for R-Pi though (the technique). I just don't have a Pi to verify it with.
by woodystanford
Thu Mar 09, 2017 2:17 am
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

This might work...

Download mongoose.h and mongoose.c directly from from Github:

https://github.com/cesanta/mongoose/

It MIGHT work. And then hang onto the code.

Someone get with me if this works, the downloading from github part I mean.
by woodystanford
Thu Mar 09, 2017 1:56 am
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Re: Embedded Web Servers

Where is my htdocs directory. You gotta make one...its in the same directory as your httpd, m****. If it ain't, there mkdir it like this: mkdir htdocs then you put in a placeholder index.html file. Just pico it like this <html><h2>WEB SERVER RUNNING!!</h2></html> and <ctrl>X out. You have your web s...
by woodystanford
Thu Mar 09, 2017 1:51 am
Forum: C/C++
Topic: Embedded Web Servers
Replies: 14
Views: 4057

Embedded Web Servers

What is the difference between a web server (like Apache) and an "embedded" web server? In my mind it has to do with footprint. If its small enough to fit on let say a PI, then its embedded. I might also mention that it has something to do with "embed-ability" in that it can be tightly coupled with ...
by woodystanford
Thu Mar 09, 2017 12:55 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

A question of how this gobbly-gook pertains to IoT. How is this an IoT tool? ***Note: that this is NOT implemented. Its up to you to code if you want to.*** Let's say you swap in the commands, read temperature and set temperature, where GET and PUT are. Let's make a basic protocol you can control a ...
by woodystanford
Thu Mar 09, 2017 12:03 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

Here is an example block diagram of two Pi's being used for a python-based IOT device. https://woodystanford.files.wordpress.com/2016/10/daemon1_python2.png Use an FTP client somehow with your Pi 1 (like an ftp command in your language or execlp out to shell) and read and write over the Inet (or LAN...
by woodystanford
Wed Mar 08, 2017 11:10 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4658

Re: Invoking Service Daemons from Woody's "Private Reserve"

Here is an example of how you can use DAEMON1 as a C Server for a Python program: https://woodystanford.files.wordpress.com/2016/10/daemon1_python1.png What you can do in python (I don't know python yet) is just write a file with ndc as its extension. DAEMON1 has the ability to get and put a value t...

Go to advanced search