It's hard to concentrate on finding the configuration error with a pack of hounds baying for you blood all around.
It's kind of like being at work.....except management often has more compassion that a family without Facebook!!! (OMG! He killed Facebook!!!)
It's all better now. Everyone is happy. I have a WIFI dongle in my PC connecting to the main router. That get's rid of a clunky old cable, I have the second router free to hack with and it frees up the ethernet port on my PC so I can connect to the second router.
Sounds like a win-win for Heater - we won't let on to the subtle points in your plan of disruption. (Is this like when at work they won't let you schedule a change for something you need to do, so there is a mysterious "incident"?)
Murphy has cunning ways to compound you troubles. For example:
OK the network outage was my fault. But then we have one XP computer here used for serious business that decided to forget all about it's network configuration at the same time. That, according to it's owner, is all my fault. More blood letting. Never mind, easily fixed.
Then there is a Windows 7 laptop here, mostly used for Fishbook and FarmVile. It had it's CPU pegged to 100% running the FarmVile FLASH and was as unresponsive as hell. That was clearly my fault as well. Out comes the noose.
They say there is such a thing as "internet addiction". Well for sure you could take the booze away from an alcoholic and have a less violent reaction than I have seen today:)
I like the idea of the "mysterious incident". Might be a way to get thanks for "fixing it" than abuse for breaking it. Nah, probably not...
Was Lucy a red head? I never knew. Only ever seen the show as a kid when we only had black and white TV.
Here is a series of photos of my MR3020 setup. So far no GPIO mods... just the Console Serial Port cable. I have to remove the 4 pin header and solder in a 90 degree one to reclose the case. But the hardware is all there to connect with a Propeller Proto Board in Tachyon Forth. You just remove the USB2SER and plug into the Propeller Protoboard.
You can actually see the 10K resistor on the cable end plugged into the board. I did this because it would have been easy to remove it no needed (or didnt't work). When I rebuild, I think the 10k will be soldered on the backside of the board so that a plain cable will be used.
I do see that the links mention that really fast character feed rate will muddle the 115200 baud connection. PuTTY and Minicom can both be configured to put a delay inbetween each character set to remove that problem.. easy-peasy. I have noticed the problem with using Minicom and my keyboard, but I just typed slower and it went away.
Just be sure to go slowly and carefully when using a knife to open the case... quite a bit of glue in there. One could slip and have to visit the ER.
Nice pics of a neat little box. Is it so that the Chinese are getting wise and starting to keep the best stuff for themselves? After all they have a huge home market.
What are the Chinese doing? One really wonders... along with "What is Putin up to?"
The WR710N is for USA and Europe at $27.50 USD and has TWICE the flash at 8Mbytes over the wr703N.
It also has two LAN ports and plugs directly into a mains outlet. If one wants it to be powered by only low voltage, the MAINS power can be shut down and by-passed.
So I would have to say something different is going on with the WR703N.
I would be asking, "Why to Americans pay extra for stuff that the rest of the world is getting more cheaply?" The MR30200 is $21.00 USD in Kaohsiung, and at least $35,00 in the USA.
The truth is that in most export versus domestic production, the domestic market gets the junk that didn't or won't sell abroad. So Hood River apples imported here from Oregon are better than what I bough while living there.
Odd that. They rear a lot of pigs in Denmark and export them to the UK and Ireland. But I found it impossible to get a decent bacon breakfast in Denmark:)
From my command centre, my old PC, I can ssh into my upstream main router or my "sideways" router or reach the internet.
If I'm logged into either router, via ssh, I can reach the internet.
The "upstream" main router is reached via a WIFI dongle on my PC.
The "sideways" router is cable connected to the PC but then reaches the upstream router via WIFI. That is to say its a bit "backwards", the WIFI is the WAN port to the internet. It also has the serial connection.
There is a whole bunch of other machines here reaching the internet via the "upstream" router.
I should make a diagram of all this so that I can keep it all straight in my head.
Sadly there is not enough room on these boxes to install the OSPF routing daemon. That would take care of setting all this up automatically and re-routing things if connections changed.
In a past life we set up networks of hundreds of boxes using OSPF to maintain the routing. They works to this day. When we reported bugs in OSPF we were told we had one the biggest OSPF networks in the world! About 300 redundantly connected nodes.
Now to find a "thing" to put on the Internet of Things....
Downstream, upstream... my oh my. I finally got into my main wifi router and verified I have it set up as a DCHP Host that may not work with the Static IP unless I provide a special entry for the 192.168.3.1
And so, I will shift it all back to Static and just try to get the MR3020 recognized. My intuition about needing the DCHP client configuration was correct... but obviously I am not out of the woods. Where is my dear LuCi?
From what I have read, it seems that the WR703N wifi will handle up to 32 separate SSID devices at the same time... more than most could wish for.
Odd that. They rear a lot of pigs in Denmark and export them to the UK and Ireland. But I found it impossible to get a decent bacon breakfast in Denmark:)
It is called Balance of Trade... every one wants a large positive balance. Retail computers in Taiwan are not as choice as the USA even though they are all made here. Now you know why one would bring coals to Newcastle.
+++++++++
I still have to figure out exactly how I want to have this program the Propeller. I am thinking ...
Notebook wifi >>>>>>>>> MR3020 wifi to serial >>>>>> to Propeller.
But I needed the MR3020 to first allow LuCi and an active WAN in order to download and instal opkg packages. And I may need to return to that configuration from time to time.
It's hard to follow along on this phone but I have to say again that you should not need any static IP addresses in your routers. Why are you doing that?
It's hard to follow along on this phone but I have to say again that you should not need any static IP addresses in your routers. Why are you doing that?
Now I must get back to the BBQ:)
If you would be so kind as to teach me.... I wouldn't be struggling so.
I am thinking that I need a Static configuration to reach LuCi. I was shut out when I shifted to DCHP. And I was also shut out of SSH at the same time.
I have been trying to think of way to help. It would be a good start if I could exactly describe how I got to where I am, but there has been some trial and error going on here so I'm not sure I can write down reproducible steps any more. Other than those I posted earlier. And of course it's not certain that your set up is exactly like either of my two routers so it might be misleading or confusing.
For example: Here my "upstream" router is connected via it's WAN port to the internet provider. It uses DHCP over it's WAN port to get a public IP address from there. It then runs a DHCP server to issue local LAN addresses, 192.168.1.xx to connected client machines. If I understand correctly the box you connect to for your internet connection issues local LAN addresses already.
So, at least you want to tell your router that it's local LAN is some different address. 192.168.2.0 vs 192.168.1.0, or whatever it is.
And there I might already have misled by saying don't use any static addresses. But of course my "downstream" router did have to be told that it's LAN is 192.168.2.0 not 192.168.1.0 as used by the "upstream" router.
Now, what I would expect, and I could be wrong, is that if you put a fresh install of OpenWRT on your box, connect the ethernet to whatever hole you internet comes from, connect the serial port to you PC/Laptop, then when the router boots up you issue an "ifconfig" command you should see that the ethernet interface has collected an IP address from you internet provider. At that point you should be able to issue ping commands, "ping google.com" say, and get replies.
I had to get at least that far before proceeding because the d-link binary does not have Luci, I needed to get to the internet to install Luci.
If you get that far we can think about the next step. If you don't get that far we have to think about what to do.
Aside: Of course for connecting Propellers or other things to the IoT that is as far as you have to go. You already have connectivity.
I had a brief look at DD-wrt the other day. Having come this far with OpenWRT I don't have any inclination to start over again with DD-wrt unless there is something show stopping ahead. I would not count on DD-wrt being any easier. The problems are the same.
@Heater
It seems that what you are doing is termed a 'wireless bridge'. One wireless router is conventional, and the other uses the 'wireless' to bridge into it.
That certainly isn't what I have been trying to get going. I simplly desire to program Propellers wireless. But in the process, I have to establish an interim solution to download opkt packages.
So it seems a two step process.
When I look at what I supposedly have, it is just two physical LANs, wlan0 and eth0.
So I thought that all I had to do was bridge the two together. Apparently, that's not enough. The /etc/config/network list three items in other installations, whereas I have only two.
On the security side, I don't quite understand [1] why both the SSH and LuCi went down, [2] how to revive each.
++++++++++++
None of this is urgent. It is is all forcing me to get organized and learn more.
I am re-reading all of this thread and looking at all the suggestions.
++++++++++++
SSH revival is likely a matter of disconnecting and restarting Dropbear and logging in again and/or reassigning a password.
LuCi seems to be using a VPN as a security layer... something I am not familiar with.
It came up automatically and behaved nicely until I switched the LAN configuration from Static to DHCP. Not sure what the cause and effect relationship is.
OpenWrt tends to write a generic explanation and an added platform specific explanation of various topics. I am not sure the coordination is always well done.
DD-Wrt seems to be more educational overview in how it writes about topics.
So both seem useful to me for reading up on configuration. After all, it is all Linux, isn't it? The goal is to get these little devices to do much more than a conventional router setup. Eventually, it would be fun to put one on a mobile robot with a USB camera and be able to control its roaming and camera via a wifi link.
+++++++++
At this point, I am just trying to
A. Regain LuCi and SSH entry as I have only RS232 Serial Console
B. Reconfigure to reach the WWW so I can download stty, minicom, and ser2lan from opkg.
You seem to be settling into your new wifi bridge. Maybe it is time to get a WR703N or MR3020 to fool with independently? (Or... God forbid, OpenWrt installed on a Raspberry Pi.)
Are you actually going to try to have a wireless programmer for the Propeller? I presumed that was what all the GPIO was for.
I am now at the crossroads, trying to decide what to do next.
I have my 703 setup as follows...
1. WiFi connection to my main internet router
2. Ethernet connection to my PC. My PC can now...
(a) SSH into my 703 to perform various things such as turn GPIOs on/off
(b) Connect to the internet using IE, Chrome, email, etc
3. Serial connection (main control port)
Where to next? These are the things I need to do, but in what order I am unsure.
1. Connect in from the internet from a remote PC.
(a) How do I do this?
(b) Initially just want to read and/or write to a GPIO pin
2. Connect in via another 703 on my local WiFi network.
(a) How do I do this?
(b) Initially just to read/write a GPIO
3. Connect my Propeller to the Serial Port
(a) Need to disable the serial port from being the Linux control port
(b) Allow 1 & 2 above to communicate with the Propeller
(c) I probably need a program running under Linux/OpenWrt
Re: 1. Connect in from the internet from a remote PC.
This requires that the machine, your router in this case, that you want to reach from the internet always has the same IP address. This is not done by assigning it a static address but rather by telling the router up stream from it that it should always allocate the same address via DHCP. So called "static lease" in the OpenWRT world. Basically you tell the upstream router to check the MAC address of your target machine every time it connects and assign the same IP address to that MAC address.
This requires configuring in you upstream router. I have no idea what that is so I cannot advise. If it were another OpenWRT router you could do it via Luci. Have a look at the bottom of the page at "Network->DHCP and DNS" where you will see how to add static leases. Just fill in the MAC address of the target machine and the IP address you want it to have. Best just to use the IP address it has currently been assigned.
There will be some similar page in your internet facing "upstream" router.
The second thing you need is to overcome the fact that these devices have non-internet, local LAN, addresses. This is done by "port forwarding". Basically an incoming connection from the internet to a port number, say 5555, is forwarded to some device with a local LAN address, perhaps on a different port like 22 for SSH.
Again this has to be configured in your internet facing "upstream" router. So I cannot advise. If that were an OpenWRT router you would do it on the page "Firewall->Port Forwards". You will see there how to add the external WAN (internet facing) port number you want to use and the IP address and port number of the target you want to reach.
The final thing you need is a known public IP address of your internet connection so that you can contact it from outside. Your internet facing router should be able to tell you that.
Oh and and preferably a host name that resolves to that IP address so that you can find it from outside. That IP address may also be dynamically allocated. I do this by using the free hostname service at afraid.org. More on that later maybe.
Easy ha!
I was about to tackle all this here with the new OpenWRT setup as I need to be able to reach my PC at home form outside. So we can discuss more of this as we go along.
Re: 1. Connect in from the internet from a remote PC. (again)
Conversely the other answer to this question is don't do that!
The other way to get data in out out of your thing on the internet is to have it connect to a server that is publicly reachable and exchange data over that connection.
In that way you don't have to configure any of the above in your network at home.
For example, your "thing" is a thermostat measuring temperature and turning heaters on and off. Have it connect to a web server out in the cloud. Have that web server present temperature values and graphs to visiting browsers. Allow those browsers to send commands back to the thermostat.
Thanks heater.
Your first solution has a problem for me - I think. I don't believe I have a static IP address because I am actually on the mobile 3G network.
Therefore, your second solution sounds better, so I will look at that solution...
I guess therefore, my IOT devices will have to go out to the internet and post new results as things change because there is no other way to get into the network?
I do have my own hosted websites which have permanent IP addresses, so I can probably run some form of a script on those servers - php???
I presume I could also send out my IP address each time I get given a new address. But lets try and keep it as simple as possible first.
So, I need to compile a program that will run on my 703, and every so often, scan the GPIOs and send out the results. I have no idea how to do this though. Let's make it simple and just read GPIO#29 (every say 1 minute) and send out the results.
What do I need at the other end???
My websites are on ixwebhosting.com and iPage although I keep thinking about ditching iPage.
I saw the Electric Imp. Sounded good but I didn't like the proprietary parts including the cloud, and the services cost monthly.
I agree. I think having the "thing" connect out may well be a lot easier than having to mess with all this router setup. Also it means that you can totally change the network hardware and config in your home system and not have to redo all this work for your "thing"
It's shitty. It's a result of the limited addresses available in IPV4. It means your things are not really on the internet at all. They are on a local private network. "IoT" is a fallacy until all "things" get an IPV6 address and are peers on the internet.
It's shitty because there are many getting ready to exploit this fact and offer IoT services for cash. And Google hoping to invade your life even more by offering services like NEST.
If you have a web server out there you are in business. Check this out: On your router you have the "wget" program. It can make requests to web servers from the command line. Try logging in over SSH and issuing a command like "$wget yourhostname.com". You should see it fetch the home page of your server and save it as index.html which you can then view with cat or vi or less.
That sorts out internet to "thing" communication, you just have to script wgets every now and then and read the file you got. wget can be used to fetch plain text or any other kind of data so that makes using the data easy. You just have to make some PHP to deliver what you want on a given URL then you can do "$ wget yourhostname.com/command.txt" or whatever.
wget can also be used to send data a up to the server by adding parameters, for example "wget yourhostname.com/telemetry/temperature/28" or by sending POST requets etc.
So all you need is some PHP, or whatever you use, on your server to respond to all that correctly, a web page to display what you want and a script on the "thing" to send and receive via wget.
Maybe it is time to get a WR703N or MR3020 to fool with independently?
Perhaps it's time I took you up on your offer of that router.
Trying to offer any help is very hard with out knowing exactly what you are up against. Getting a feel for how it goes. If the router on offer is the same as the one you are using or at least very similar perhaps we could make progress faster by both working on the same thing.
If it's not to expensive in postage PM and me and I'll send you my address.
(Or... God forbid, OpenWrt installed on a Raspberry Pi.)
I'm resisting the temptation. Currently my Pi's can do everything we want to do here without all this frikkin hassle!
But there are new Pi's on the way so one of those might get dedicated to OpenWRT just for fun.
Are you actually going to try to have a wireless programmer for the Propeller? I presumed that was what all the GPIO was for.
Yep. I was up till 4 in the morning fetching and building propgcc and trying to figure out how we are going to extract the loader form there and get it cross-compiled for these routers. No luck so far....
Thanks heater. Going to read about these suggestions. This sounds like the WTG. Do it manually first, then automate it.
Basically I am going to have a group of 703s on the wifi network. Initially they all can send their data up to the server, and I can see that info on a web page. Sounds great. Then I can make my webpage have some buttons to send data back down.
Once done, then I can take the next step and replace the simple GPIO with the serial port and a propeller. This will all be done at the 703 end and will just be a more complex webpage and wget instructions.
++++++++++++++++++++++++++++++++
For downloading to the prop for Loopy...
Probably best to get the serial working to/from the prop first. I've read that the routers cannot sustain 115200 baud, so slight delays need to be put between characters sent to the router. Best to keep 115,200.
Once done, we should be able to setup a reset via GPIO#29 and then send a simple download program (as just hex data embedded in a script rather than a file to start with) just to flash a prop led. Need to start simply.
Umm. if SSH via Dropbear is working properly, can't you just use SFG to transfer files to the WR703N.
One does have to watch space carefully unless you are adding Ex-root to allow a USB memory stick to extend your file system. (Heater doesn't have USB).
What is Heater cross-compiling for? His DIR-615 or the WR-703N? It gets a bit confusing as one is Ralink and the other in Anthros. Seems we are not going to share any binaries, just provide proof of concept.
Yes indeed, if your ssh set up is working nicely you can even create ssh tunnels from your router to some server on the internet. SSH makes the connection out as a client and on the server you get to be able to ssh back to the router as and when you choose. Or transfer files to it. I forget the details of how to do this. Rather like using some kind of VPN software.
Doing things over HTTP/HTTPS using port 80 and whatever HTTPS uses is the "modern" way to do all this. It can circumvent a lot of problems with firewalls and God knows what you have to deal with in order to get out of you local LAN. Besides it's dead easy to program for those who know their WEB stack, PHP etc.
Yes one has to watch file system space. I only have 140K free there! But then I also have megabytes of tempfs to play in, which is in RAM. No worries.
I will be cross compiling for my MIPS based D-LINK (and perhaps Raspberry Pi some day). But that does not matter. The point is figuring out how to do it with the OpenWRT tool chain. Then anyone can then download the OpenWRT tool chain, build the required cross compiler and tools for their own particular router and the used that to cross compile whatever they want. Using whatever instructions I can put together.
This is the Linux world, we are not dependent on binary blobs. Show me the source:)
Okay, I now have LuCi and SSH without changing any of the configuration to DogHouse.
What I did was to open my Admin of my Main router and use the IP# that the DCHP server assigned, which is 192.168.1.89 since it is not the 192.168.1.0 network... works with SSH and LuCi.
Having defined DogHouse's Network as 192.168.3.0, I presumed that I logged in via SSH and Luci via 192.168.3.1 (the gateway designation). I am sure I am missing something.
But the best news is that I haven't dumped the installation with Failsafe and that I haven't done something absurd with SSH or LuCi. I am just slowly getting my bearings.
++++++++++++++++
The situation now...
Well if I have both a SSH and a LuCi interface that are active and useful. I can shut out the Serial Console Login as mentioned in a link provided by Cluso. And I can begin to download opkg packages stty, minicom, and so on ser2lan to fool around with getting a Tachyon Forth on Propeller working over the wifi.
By the way, even though I have to use a 192.168.1.89 to log in for SSH and Luci, I am going through the DogHouse wifi. I am not using my other wifi SSID (called FIREFLY) or my other computer that is on the LAN.
In sum, it gets a bit zany trying to understand where I am entering DogHouse from.
++++++++++
So I will try some opkg download and see what the packages do and how they behave.
Before any new tweaks and downloads I have 864Kbytes of free space in my LuCi reports.. if more is needed, I will explore ex-root installation.
...it gets a bit zany trying to understand where I am...
Yes. I can't make any sense out of your description:)
Here is the set up I managed to achieve on my home network:
Notice how in one router the WIFI is an access point. Allowing clients to connect to the internet. In the other router the WIFI is a "client" (or station, sta in the config files).
If my configs may be of any help to anyone I can pull them out and post them here.
Note: The serial connection to "thing" is not made yet.
Grrr...Had to update the diagram. How does one delete an attachment from a post? Like the old diagram for example.
Sorry Loopy, despite what I said I have set one static IP address. Not in a router but in my PC. It has eth0 set to 192.168.2.2 so as to access the peer router box.
Comments
It's kind of like being at work.....except management often has more compassion that a family without Facebook!!! (OMG! He killed Facebook!!!)
Sounds like a win-win for Heater - we won't let on to the subtle points in your plan of disruption. (Is this like when at work they won't let you schedule a change for something you need to do, so there is a mysterious "incident"?)
Yes, I wasn't aware you were a redhead, though!!
Turning one into an Arduino WiFi shield
Using it to send Arduino Sensor Data
Home Automation server on OpenWRT router
I was mostly looking at how other folks have configured the serial connection and which modules of OpenWRT they found most useful.
Just some light reading for when you get bored.
I still have yet to power mine up......I've been playing in the pie again!
Murphy has cunning ways to compound you troubles. For example:
OK the network outage was my fault. But then we have one XP computer here used for serious business that decided to forget all about it's network configuration at the same time. That, according to it's owner, is all my fault. More blood letting. Never mind, easily fixed.
Then there is a Windows 7 laptop here, mostly used for Fishbook and FarmVile. It had it's CPU pegged to 100% running the FarmVile FLASH and was as unresponsive as hell. That was clearly my fault as well. Out comes the noose.
They say there is such a thing as "internet addiction". Well for sure you could take the booze away from an alcoholic and have a less violent reaction than I have seen today:)
I like the idea of the "mysterious incident". Might be a way to get thanks for "fixing it" than abuse for breaking it. Nah, probably not...
Was Lucy a red head? I never knew. Only ever seen the show as a kid when we only had black and white TV.
Why not be brave and get the MR3020 at your local store elsewhere (too much money, maybe?)
While I can get the MR3020 for $21USD here, it looks like Americans are being charged more. https://shopping.yahoo.com/1555699896-tp-link-tl-mr3020-portable-3g-375g-wireless-n-router/;_ylt=AwrTWf22uM9T.gsAsjBgmolQ?bfr=0.0
The WR710N is also in western markets and an equivalent project to hack - but TWO Lan ports (very cool).
http://www.amazon.com/TP-LINK-TL-WR710N-Wireless-Repeater-Charging/dp/B00FRMAOIO/ref=pd_sim_pc_5?ie=UTF8&refRID=187KRH2N5M21XTA155VH
Here is a series of photos of my MR3020 setup. So far no GPIO mods... just the Console Serial Port cable. I have to remove the 4 pin header and solder in a 90 degree one to reclose the case. But the hardware is all there to connect with a Propeller Proto Board in Tachyon Forth. You just remove the USB2SER and plug into the Propeller Protoboard.
You can actually see the 10K resistor on the cable end plugged into the board. I did this because it would have been easy to remove it no needed (or didnt't work). When I rebuild, I think the 10k will be soldered on the backside of the board so that a plain cable will be used.
I do see that the links mention that really fast character feed rate will muddle the 115200 baud connection. PuTTY and Minicom can both be configured to put a delay inbetween each character set to remove that problem.. easy-peasy. I have noticed the problem with using Minicom and my keyboard, but I just typed slower and it went away.
Just be sure to go slowly and carefully when using a knife to open the case... quite a bit of glue in there. One could slip and have to visit the ER.
Nice pics of a neat little box. Is it so that the Chinese are getting wise and starting to keep the best stuff for themselves? After all they have a huge home market.
The WR710N is for USA and Europe at $27.50 USD and has TWICE the flash at 8Mbytes over the wr703N.
It also has two LAN ports and plugs directly into a mains outlet. If one wants it to be powered by only low voltage, the MAINS power can be shut down and by-passed.
So I would have to say something different is going on with the WR703N.
I would be asking, "Why to Americans pay extra for stuff that the rest of the world is getting more cheaply?" The MR30200 is $21.00 USD in Kaohsiung, and at least $35,00 in the USA.
The truth is that in most export versus domestic production, the domestic market gets the junk that didn't or won't sell abroad. So Hood River apples imported here from Oregon are better than what I bough while living there.
From my command centre, my old PC, I can ssh into my upstream main router or my "sideways" router or reach the internet.
If I'm logged into either router, via ssh, I can reach the internet.
The "upstream" main router is reached via a WIFI dongle on my PC.
The "sideways" router is cable connected to the PC but then reaches the upstream router via WIFI. That is to say its a bit "backwards", the WIFI is the WAN port to the internet. It also has the serial connection.
There is a whole bunch of other machines here reaching the internet via the "upstream" router.
I should make a diagram of all this so that I can keep it all straight in my head.
Sadly there is not enough room on these boxes to install the OSPF routing daemon. That would take care of setting all this up automatically and re-routing things if connections changed.
In a past life we set up networks of hundreds of boxes using OSPF to maintain the routing. They works to this day. When we reported bugs in OSPF we were told we had one the biggest OSPF networks in the world! About 300 redundantly connected nodes.
Now to find a "thing" to put on the Internet of Things....
And so, I will shift it all back to Static and just try to get the MR3020 recognized. My intuition about needing the DCHP client configuration was correct... but obviously I am not out of the woods. Where is my dear LuCi?
From what I have read, it seems that the WR703N wifi will handle up to 32 separate SSID devices at the same time... more than most could wish for.
It is called Balance of Trade... every one wants a large positive balance. Retail computers in Taiwan are not as choice as the USA even though they are all made here. Now you know why one would bring coals to Newcastle.
+++++++++
I still have to figure out exactly how I want to have this program the Propeller. I am thinking ...
Notebook wifi >>>>>>>>> MR3020 wifi to serial >>>>>> to Propeller.
But I needed the MR3020 to first allow LuCi and an active WAN in order to download and instal opkg packages. And I may need to return to that configuration from time to time.
Now I must get back to the BBQ:)
If you would be so kind as to teach me.... I wouldn't be struggling so.
I am thinking that I need a Static configuration to reach LuCi. I was shut out when I shifted to DCHP. And I was also shut out of SSH at the same time.
Of course, when I look in my /etc/config/network file,
I only have WLAN and LAN, no WAN listed. So I might have just been short of a WAN configuration from the beginning. http://www.dd-wrt.com/wiki/index.php/Separate_LAN_and_WLAN
BTW, I have been focusing entirely on OPENwrt, but DD-wrt may actually be easier to learn from. Here is a link to a nice big pile of information.
http://www.dd-wrt.com/wiki/index.php/Tutorials
I have been trying to think of way to help. It would be a good start if I could exactly describe how I got to where I am, but there has been some trial and error going on here so I'm not sure I can write down reproducible steps any more. Other than those I posted earlier. And of course it's not certain that your set up is exactly like either of my two routers so it might be misleading or confusing.
For example: Here my "upstream" router is connected via it's WAN port to the internet provider. It uses DHCP over it's WAN port to get a public IP address from there. It then runs a DHCP server to issue local LAN addresses, 192.168.1.xx to connected client machines. If I understand correctly the box you connect to for your internet connection issues local LAN addresses already.
So, at least you want to tell your router that it's local LAN is some different address. 192.168.2.0 vs 192.168.1.0, or whatever it is.
And there I might already have misled by saying don't use any static addresses. But of course my "downstream" router did have to be told that it's LAN is 192.168.2.0 not 192.168.1.0 as used by the "upstream" router.
Now, what I would expect, and I could be wrong, is that if you put a fresh install of OpenWRT on your box, connect the ethernet to whatever hole you internet comes from, connect the serial port to you PC/Laptop, then when the router boots up you issue an "ifconfig" command you should see that the ethernet interface has collected an IP address from you internet provider. At that point you should be able to issue ping commands, "ping google.com" say, and get replies.
I had to get at least that far before proceeding because the d-link binary does not have Luci, I needed to get to the internet to install Luci.
If you get that far we can think about the next step. If you don't get that far we have to think about what to do.
Aside: Of course for connecting Propellers or other things to the IoT that is as far as you have to go. You already have connectivity.
I had a brief look at DD-wrt the other day. Having come this far with OpenWRT I don't have any inclination to start over again with DD-wrt unless there is something show stopping ahead. I would not count on DD-wrt being any easier. The problems are the same.
It seems that what you are doing is termed a 'wireless bridge'. One wireless router is conventional, and the other uses the 'wireless' to bridge into it.
That certainly isn't what I have been trying to get going. I simplly desire to program Propellers wireless. But in the process, I have to establish an interim solution to download opkt packages.
So it seems a two step process.
When I look at what I supposedly have, it is just two physical LANs, wlan0 and eth0.
So I thought that all I had to do was bridge the two together. Apparently, that's not enough. The /etc/config/network list three items in other installations, whereas I have only two.
On the security side, I don't quite understand [1] why both the SSH and LuCi went down, [2] how to revive each.
++++++++++++
None of this is urgent. It is is all forcing me to get organized and learn more.
I am re-reading all of this thread and looking at all the suggestions.
++++++++++++
SSH revival is likely a matter of disconnecting and restarting Dropbear and logging in again and/or reassigning a password.
LuCi seems to be using a VPN as a security layer... something I am not familiar with.
It came up automatically and behaved nicely until I switched the LAN configuration from Static to DHCP. Not sure what the cause and effect relationship is.
OpenWrt tends to write a generic explanation and an added platform specific explanation of various topics. I am not sure the coordination is always well done.
DD-Wrt seems to be more educational overview in how it writes about topics.
So both seem useful to me for reading up on configuration. After all, it is all Linux, isn't it? The goal is to get these little devices to do much more than a conventional router setup. Eventually, it would be fun to put one on a mobile robot with a USB camera and be able to control its roaming and camera via a wifi link.
+++++++++
At this point, I am just trying to
A. Regain LuCi and SSH entry as I have only RS232 Serial Console
B. Reconfigure to reach the WWW so I can download stty, minicom, and ser2lan from opkg.
You seem to be settling into your new wifi bridge. Maybe it is time to get a WR703N or MR3020 to fool with independently? (Or... God forbid, OpenWrt installed on a Raspberry Pi.)
Are you actually going to try to have a wireless programmer for the Propeller? I presumed that was what all the GPIO was for.
I have my 703 setup as follows...
1. WiFi connection to my main internet router
2. Ethernet connection to my PC. My PC can now...
(a) SSH into my 703 to perform various things such as turn GPIOs on/off
(b) Connect to the internet using IE, Chrome, email, etc
3. Serial connection (main control port)
Where to next? These are the things I need to do, but in what order I am unsure.
1. Connect in from the internet from a remote PC.
(a) How do I do this?
(b) Initially just want to read and/or write to a GPIO pin
2. Connect in via another 703 on my local WiFi network.
(a) How do I do this?
(b) Initially just to read/write a GPIO
3. Connect my Propeller to the Serial Port
(a) Need to disable the serial port from being the Linux control port
(b) Allow 1 & 2 above to communicate with the Propeller
(c) I probably need a program running under Linux/OpenWrt
Does this sound reasonable???
Re: 1. Connect in from the internet from a remote PC.
This requires that the machine, your router in this case, that you want to reach from the internet always has the same IP address. This is not done by assigning it a static address but rather by telling the router up stream from it that it should always allocate the same address via DHCP. So called "static lease" in the OpenWRT world. Basically you tell the upstream router to check the MAC address of your target machine every time it connects and assign the same IP address to that MAC address.
This requires configuring in you upstream router. I have no idea what that is so I cannot advise. If it were another OpenWRT router you could do it via Luci. Have a look at the bottom of the page at "Network->DHCP and DNS" where you will see how to add static leases. Just fill in the MAC address of the target machine and the IP address you want it to have. Best just to use the IP address it has currently been assigned.
There will be some similar page in your internet facing "upstream" router.
The second thing you need is to overcome the fact that these devices have non-internet, local LAN, addresses. This is done by "port forwarding". Basically an incoming connection from the internet to a port number, say 5555, is forwarded to some device with a local LAN address, perhaps on a different port like 22 for SSH.
Again this has to be configured in your internet facing "upstream" router. So I cannot advise. If that were an OpenWRT router you would do it on the page "Firewall->Port Forwards". You will see there how to add the external WAN (internet facing) port number you want to use and the IP address and port number of the target you want to reach.
The final thing you need is a known public IP address of your internet connection so that you can contact it from outside. Your internet facing router should be able to tell you that.
Oh and and preferably a host name that resolves to that IP address so that you can find it from outside. That IP address may also be dynamically allocated. I do this by using the free hostname service at afraid.org. More on that later maybe.
Easy ha!
I was about to tackle all this here with the new OpenWRT setup as I need to be able to reach my PC at home form outside. So we can discuss more of this as we go along.
Re: 1. Connect in from the internet from a remote PC. (again)
Conversely the other answer to this question is don't do that!
The other way to get data in out out of your thing on the internet is to have it connect to a server that is publicly reachable and exchange data over that connection.
In that way you don't have to configure any of the above in your network at home.
For example, your "thing" is a thermostat measuring temperature and turning heaters on and off. Have it connect to a web server out in the cloud. Have that web server present temperature values and graphs to visiting browsers. Allow those browsers to send commands back to the thermostat.
This is the approach taken by Nest, which google has just bought for billions. By the "Electric Imp" which does everything we are doing for 30 dollars in an SD Card form factor! http://electricimp.com/ and https://learn.sparkfun.com/tutorials/electric-imp-breakout-hookup-guide. It's used by Sparkfun in it's own new IoT efforts.
We, of course, don't like to use and pay for other peoples services like that so it would be better to host our own some how....
Your first solution has a problem for me - I think. I don't believe I have a static IP address because I am actually on the mobile 3G network.
Therefore, your second solution sounds better, so I will look at that solution...
I guess therefore, my IOT devices will have to go out to the internet and post new results as things change because there is no other way to get into the network?
I do have my own hosted websites which have permanent IP addresses, so I can probably run some form of a script on those servers - php???
I presume I could also send out my IP address each time I get given a new address. But lets try and keep it as simple as possible first.
So, I need to compile a program that will run on my 703, and every so often, scan the GPIOs and send out the results. I have no idea how to do this though. Let's make it simple and just read GPIO#29 (every say 1 minute) and send out the results.
What do I need at the other end???
My websites are on ixwebhosting.com and iPage although I keep thinking about ditching iPage.
I saw the Electric Imp. Sounded good but I didn't like the proprietary parts including the cloud, and the services cost monthly.
I agree. I think having the "thing" connect out may well be a lot easier than having to mess with all this router setup. Also it means that you can totally change the network hardware and config in your home system and not have to redo all this work for your "thing"
It's shitty. It's a result of the limited addresses available in IPV4. It means your things are not really on the internet at all. They are on a local private network. "IoT" is a fallacy until all "things" get an IPV6 address and are peers on the internet.
It's shitty because there are many getting ready to exploit this fact and offer IoT services for cash. And Google hoping to invade your life even more by offering services like NEST.
If you have a web server out there you are in business. Check this out: On your router you have the "wget" program. It can make requests to web servers from the command line. Try logging in over SSH and issuing a command like "$wget yourhostname.com". You should see it fetch the home page of your server and save it as index.html which you can then view with cat or vi or less.
That sorts out internet to "thing" communication, you just have to script wgets every now and then and read the file you got. wget can be used to fetch plain text or any other kind of data so that makes using the data easy. You just have to make some PHP to deliver what you want on a given URL then you can do "$ wget yourhostname.com/command.txt" or whatever.
wget can also be used to send data a up to the server by adding parameters, for example "wget yourhostname.com/telemetry/temperature/28" or by sending POST requets etc.
So all you need is some PHP, or whatever you use, on your server to respond to all that correctly, a web page to display what you want and a script on the "thing" to send and receive via wget.
Now that is easy ha?
Have a look at the wget man pages here: http://www.computerhope.com/unix/wget.htm
Especially find the --post-data and --post-file options. There are nice examples.
You can try these out manually against your server. Then you need to learn how to write some shell script to automate it all.
Perhaps it's time I took you up on your offer of that router.
Trying to offer any help is very hard with out knowing exactly what you are up against. Getting a feel for how it goes. If the router on offer is the same as the one you are using or at least very similar perhaps we could make progress faster by both working on the same thing.
If it's not to expensive in postage PM and me and I'll send you my address.
I'm resisting the temptation. Currently my Pi's can do everything we want to do here without all this frikkin hassle!
But there are new Pi's on the way so one of those might get dedicated to OpenWRT just for fun.
Yep. I was up till 4 in the morning fetching and building propgcc and trying to figure out how we are going to extract the loader form there and get it cross-compiled for these routers. No luck so far....
Basically I am going to have a group of 703s on the wifi network. Initially they all can send their data up to the server, and I can see that info on a web page. Sounds great. Then I can make my webpage have some buttons to send data back down.
Once done, then I can take the next step and replace the simple GPIO with the serial port and a propeller. This will all be done at the 703 end and will just be a more complex webpage and wget instructions.
++++++++++++++++++++++++++++++++
For downloading to the prop for Loopy...
Probably best to get the serial working to/from the prop first. I've read that the routers cannot sustain 115200 baud, so slight delays need to be put between characters sent to the router. Best to keep 115,200.
Once done, we should be able to setup a reset via GPIO#29 and then send a simple download program (as just hex data embedded in a script rather than a file to start with) just to flash a prop led. Need to start simply.
One does have to watch space carefully unless you are adding Ex-root to allow a USB memory stick to extend your file system. (Heater doesn't have USB).
What is Heater cross-compiling for? His DIR-615 or the WR-703N? It gets a bit confusing as one is Ralink and the other in Anthros. Seems we are not going to share any binaries, just provide proof of concept.
Yes indeed, if your ssh set up is working nicely you can even create ssh tunnels from your router to some server on the internet. SSH makes the connection out as a client and on the server you get to be able to ssh back to the router as and when you choose. Or transfer files to it. I forget the details of how to do this. Rather like using some kind of VPN software.
Doing things over HTTP/HTTPS using port 80 and whatever HTTPS uses is the "modern" way to do all this. It can circumvent a lot of problems with firewalls and God knows what you have to deal with in order to get out of you local LAN. Besides it's dead easy to program for those who know their WEB stack, PHP etc.
Yes one has to watch file system space. I only have 140K free there! But then I also have megabytes of tempfs to play in, which is in RAM. No worries.
I will be cross compiling for my MIPS based D-LINK (and perhaps Raspberry Pi some day). But that does not matter. The point is figuring out how to do it with the OpenWRT tool chain. Then anyone can then download the OpenWRT tool chain, build the required cross compiler and tools for their own particular router and the used that to cross compile whatever they want. Using whatever instructions I can put together.
This is the Linux world, we are not dependent on binary blobs. Show me the source:)
What I did was to open my Admin of my Main router and use the IP# that the DCHP server assigned, which is 192.168.1.89 since it is not the 192.168.1.0 network... works with SSH and LuCi.
Having defined DogHouse's Network as 192.168.3.0, I presumed that I logged in via SSH and Luci via 192.168.3.1 (the gateway designation). I am sure I am missing something.
But the best news is that I haven't dumped the installation with Failsafe and that I haven't done something absurd with SSH or LuCi. I am just slowly getting my bearings.
++++++++++++++++
The situation now...
Well if I have both a SSH and a LuCi interface that are active and useful. I can shut out the Serial Console Login as mentioned in a link provided by Cluso. And I can begin to download opkg packages stty, minicom, and so on ser2lan to fool around with getting a Tachyon Forth on Propeller working over the wifi.
By the way, even though I have to use a 192.168.1.89 to log in for SSH and Luci, I am going through the DogHouse wifi. I am not using my other wifi SSID (called FIREFLY) or my other computer that is on the LAN.
In sum, it gets a bit zany trying to understand where I am entering DogHouse from.
++++++++++
So I will try some opkg download and see what the packages do and how they behave.
Before any new tweaks and downloads I have 864Kbytes of free space in my LuCi reports.. if more is needed, I will explore ex-root installation.
This is essentially a wifi to ethernet bridge. It also supports 802.11n in the 5ghz range. Not bad for $7.99.
http://www.ebay.com/itm/Belkin-Universal-Wireless-HDTV-Adapter-Used/371107718602?_trksid=p2045573.c100033.m2042&_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D24143%26meid%3D8543831956076953231%26pid%3D100033%26prg%3D10240%26rk%3D2%26rkt%3D4%26sd%3D141140823741
The second link is to a device that appears to actually switch a household 110VAC outlet via wifi. That would appeal to some of us.
http://wiki.openwrt.org/toh/belkin/start
http://wiki.openwrt.org/toh/belkin/f7c027
Here is the set up I managed to achieve on my home network:
Notice how in one router the WIFI is an access point. Allowing clients to connect to the internet. In the other router the WIFI is a "client" (or station, sta in the config files).
If my configs may be of any help to anyone I can pull them out and post them here.
Note: The serial connection to "thing" is not made yet.
Sorry Loopy, despite what I said I have set one static IP address. Not in a router but in my PC. It has eth0 set to 192.168.2.2 so as to access the peer router box.