Shop OBEX P1 Docs P2 Docs Learn Events
WiFi & IOT for home controllers/monitors using WR703N $20 routers and xx-WRT - Page 3 — Parallax Forums

WiFi & IOT for home controllers/monitors using WR703N $20 routers and xx-WRT

1356719

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-15 00:56
    heater:
    I don't agree. The WR703N has been on the market since at least the start of 2011. It is available from many suppliers on eBay and Aliexpress. It seems that there are more hackers using this than there are using routers. The later software updates have been incorporating some of the later Linux releases. This box is available in both Chinese versions (they are cheaper) and English versions (which are CE approved) although there seems to be no difference in the hw. (There is a slight difference in my units which may be the update to the CE approval).
    I have had no problem in getting the WR703N and I have done so from 2 different suppliers. I can buy large quantities too.

    BTW I fumbled thru with vi without problems. I verified by doing a cat on the file(s).

    I am intending to use a number of these, so $18-20 vs $38 and lower power is what I am after.
    Glad I didn't buy a R-Pi last week :) My son bought one less than 2 mths ago with a box - shame but he wanted to return mine, not that I wanted it back yet.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-15 03:21
    Heater's passion for the Raspberry Pi is well-known, maybe infamous in some circles.

    Today's visit to the local electronic's shop showed a big restock of WR702N boxes and MR3020 boxes -- still on sale... not a WR703N in sight. They might have been available two days ago, but you might have to settle for MR3020 boxes in the future -- with the glue and different GPIO.

    There are times that I just wish our R-PI maven would go teach The TWO Million Pi Users he claims existant than to bother with diverting Parallaxians to his personal choices. There are a lot of parents waiting for their 10 year olds to do something brilliant with the Pi they purchased for them. Plenty of persons needy for support. Why be so greedy?

    The WR703N or MR3020 seems to be a 'match made in heaven' for programing Propeller chips with touchpads and 3G/4G devices. My focus here is on Propeller support development... right?


    And I will Never buy a Raspberry Pi, so please don't ask. I shopped and found the Allwinner A10 CubieBoard1 to be more to my liking == more robust, more memory, more features. Not even the new B+ will sway me. I even purchased a Wifi interface for it that I haven't had time to yet explore.

    ===

    Underneath all of the variations of detailed router board installation, the OpenWRT firmware is a minimalist Linux that is very up-to-date, and headless (no HDMI to fool with). Because it is minimalist, we get VI and ASH for the sake of a tiny foot print.

    This is not Ubuntu or Mint and while the device has not keyboard, mouse or HDMI interface -- I suspect it can install an httpd to use a Wifi interfaced device with software installed within (maybe even SimpleIDE?)

    And soo.......With wifi you might be able to get Gedit eventually running, but I won't bother with the long explanation of how I might do so. But I am thinking of trying.

    ++++++++++++++

    I don't want to offend Heater too much as we might need him to guide us in how to get one of those pesky GPIO pins operational.

    ++++++++++++++

    I do want to make the point that when you successfully login, you are in the Linux OS and can use the usual utilities to see where you are. This is a parallel and ancient universe, similar to CPM and MSDOS. You just have to learn the UNIX way.


    What next?
    Try 'ls -l' to get a list of what is in in the directory you are in. You can explore the file system and compare it to the partitions that are mentioned on the Boot Log.

    To get the Wifi working, you do have to open a file or create a file and provide a correct configuration. At this point, you will be blindly following proceedure. But eventually you will grasp how Linux relies on files, links, and a few other items to get the whole working well.

    And for now, it is nice to know that you do have a file directory that you can download a Propeller binary into for later transfer out your serial port and into the Propeller (as long as you don't use up all the space with additional Linux applications).

    That's all for now.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-15 03:45
    I wondered what httpd was. Its on my install list of instructions to get wifi working.

    I know I am in Linux and I already did cat to confirm that the files I modified with vi were done correctly. I tried ls but there was nothing displayed so I need some parameters. I have been reading an old Linux shortform book that came with a magazine a few years ago.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-15 04:09
    "ls" will show nothing if your current directory is empty. "ls -la" should show a detailed list of all files including the current working directory "." and the next directory up "..". Not that "cd .." changes the current working directory to the next one up, the parent. "pwd" should show the current (present) working directory.

    What about "ls -laR /". That should recursively list all files from the root downward, everything in the system. "ls -l /bin /sbin" should list all the executable commands you have available. There may be other directories where commands can be found.

    The busybox commands don't support all the options of a full up desktop shell, so as to reduce size, so some of the above may not work as expected.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-15 04:26
    heater,
    thanks for the ls command parameters. Yes, I remember seeing the pwd command and thinking before I read that it was a password command - ugh!

    What does LUCI do? I know its a gui and some of the parameters to set the router parameters. Its part of the install and runs.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-15 04:32
    LUCI works with your web server (httpd) to serve up the web pages that are a web configuration interface for your router. Much like the web admin interface your router had out of the box. That's all I know about it.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-15 06:13
    Well, I pries the board out of the case for the MR3020 and soldered a 4 piin header in place to provide Tx, Rx, Vdd, and Ground.
    Also, there is a strong suggestion to add a 10K pullup resistor to the Tx.
    The examples show doing this with the cable that plugs into the board. Another option is to solder the 10K in an 1/8 watt resister to the pins on the side opposite the header and have the cable be simple.

    @Heater
    Thanks for the added Linux details. I do appreciate your depth of knowledge and greater experience.

    I loose patience at times because R-Pi have had sales of at least 25 Million USD in its first year, maybe more.
    From what I can gather, Parallax has yet to reach 12 Million USD in one year. And yet, they are hard-working and very generous folks.

    Hopefully that fact that the R-PI founder works for Broadcom is not upseting you about these little TP-Link devices that use Antheros, which is Broadcom's wifi chipset competitor. I like Broadcom wifi and have used it more than Antheros.. always in Linus and Windows7.

    =========
    That other board of mine... the Allwinner A10.
    You really have to check for Linux supported USB Wifi dongles. And checking means buying, opening the box and running 'lsusb' to determine exactly what you have bought. When in doubt buy from a source that has a no-questions-asked 7 day return policy.

    I purchased a TP-Link TL-WN821N 300Mbps Wireless N USB adapter, but just finally got around to checking the Linux support -- fully supported with drivers in Liinux for all 3 versions. It is a bit fancy for just hobby work, but I'd rather have the extra speed in case I want to try video over wifi.

    If you don't take the time to check, you may just get with something that only works in Windows with proprietary drivers.

    ++++++
    So I have gone from just having a wifi router and a couple of notebooks with wifi ability to have 3 new wifi device that can pretty much allow me to be very creative in wifi. All to the good for


    BusyBox has a website with full documentation
    www.busybox.net

    It is summer and I picked up a few more English classes, so progress with my stuff will be a bit slower.

    OPENwrt and dd-wrt have created a lot of down-sized alternatives for Linux. I am somewhat more fond of simpler applications, a bit retro. And I am not interested at all in having all and everything in a GUI with high-resolution graphics. Monitors are expensive and Linux can work quite well via Wifi or using an LCD in some frugal cases.

    And a bit more about Vi.
    http://linuxmoz.com/vi-commands-cheat-sheet/


  • Heater.Heater. Posts: 21,230
    edited 2014-07-15 16:58
    Cluso, Loopy,

    A lot to talk about here. This could be a long ramble. Sorry folks.

    Between the pair of you I don't know what to think. Cluso has a unit in hand that seems to work. Meanwhile Loopy seems to been running to and fro the shops and not finding anything that can be used.

    I tried an experiment today. Our local computer mega store has about a hundred different routers in it's catalogue of all shapes, sizes and capabilities. Starting from the cheapest I tried to match them up with the supported devices mentioned on the openwrt pages. After an hour I gave up, I had been though all the reasonably priced machines. This is not a tenable platform with reliable supply around here.

    The Pi however is available off the shelf locally. In multiple outlets. Even in that same mega store. It's cheaper.

    You overstate my "passion" for the Pi. I'm quite fond of all kinds of chips and devices. I know you are "piphobic", for whatever reasons, certainly not technical, but why do you say things like "TWO Million Pi Users he claims existant" as if I pull the number out of thin air. That's about how many have been shipped. Who knows if they are all in use or not? Who cares? If kids at least get exposure to them and then forget them in the junk draw that is at least one more kid that had a chance to play with technology. What has "parents waiting for their 10 year olds to do something brilliant with the Pi" got to do with anything? One could say the same about anything else parents try to encourage in their children from books, to electronics kits to musical instruments to footballs. At least they are trying.

    I'm sure the Cubie is great. I look forward to getting a Cubie Truck. But that is a different league.

    You will not get Gedit running. Gedit requires the Gnome libraries. The Gnome libraries require X libraries. I seriously believe this will not be usable in the memory space you have available. Further you have no graphics on a router so you will have to export the GUI from Gedit to a remote X server for display. This will be as slow as hell even if you ever do get it working.

    Don't worry about me being offended, I enjoy our little chats :)

    I do appreciate the "...parallel and ancient universe, similar to CPM and MSDOS...". However saying it is similar to CPM or MSDOS is like saying a Saturn V is like a firework. Time for a story...

    Almost ten years ago I was working for a company that designed it's own router for a specialized application. 1 Ethernet, 3 DSL links, 2 or three serial interfaces and some other stuff. It was based on an PowerPC chip and ran the VxWorks operating system. It only had a few megs of RAM and FLASH.

    On my shift VxWorks was replaced with Linux because the OSPF routing never worked in VxWorks and, well, VxWorks is Smile anyway. We built our own Linux installation, wrote our own drivers for those DSL links, we used busybox and dropbear and all those things you see in your routers open firmware.

    Some time later the hardware was redesigned using an ATMEL AT91SAM ARM processor and faster DS chips. We had to move all our Linux work over to that, write new drivers etc.

    It all worked beautifully, that product is still in production today and being developed further with WIFI and such.

    I loved doing all that but eventually got really frustrated by endlessly battling against the space constraints of the thing. And those ATMEL ARM chips were pretty slow.

    Perhaps, maybe, that is why I have an aversion to getting into this router hacking business...

    If you want to program binaries into a Propeller from the router you are going to need to use the loader that is provided with Prop GCC. It is written in C. I'm not sure you are going to get any other loaders running there unless you can install Python or Mono or whatever the need to run. This will require that you have an ARM development tool chain on your PC to build the loader.



    P.S.
    I just noticed I have a D-Link DIR-615 router running the LAN in this house. And that is hackable with OpenWRT....perhaps it was time it was replaced with something more modern and given a brain transplant....

    P.P.S.
    The fact that the R-PI founder words for Broadcom is of no consequence. I have no love of Broadcom any more than STMicroelectronix, TI, Samsung, ATMEL....Save, perhaps, that it is good that Broadcom employs a lot of engineers in the UK.

  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-15 18:08
    heater,
    Thanks for your insight. Its all a matter of horses for courses, as they say.
    My main purpose/use of the WR703N is to use it as a cheap WiFi part. It has everything in the box that I need/require. I want to use it as an IOT device where some simple versions will just have a few I/Os, and more complex versions will use a prop to do the more complex I/O. I know that I will be able to use the 703 to download to the prop as there are a number of spare I/Os available. But that isn't all that important because I can write a routine in the prop that will allow downloading without resetting if necessary. The serial in the 703 is ideal for all of this.
    However, to do the mod to be able to do a proper download via WiFi has a lot of general uses. Therefore it is worth pursuing this.
    BTW it may well work out that the cheaper 702 could do the job of a WiFi downloader to the prop. This would be even better as its a few $ cheaper. Note its cheaper than a real PropPlug (although there are cheaper ways to do it).

    A few facts about the Pi
    There have been ~3M shipped (from Eben either in the latest MagPi or on the Pi website -just cannot recall which)
    The Pi used the Broadcom chip because Eben works there. He knows the chip (good reason to use it) and Broadcom probably supported the idea of a Foundation.
    I am impressed with the chip and the chip on chip technology - maybe a bit more expensive but when compared to saving pcb routing and pins required, maybe comes out in the wash.
    I am glad they have continued with the same chip for both the DIMM module and the B+ as it makes everything compatible.
    And now (because of the numbers I suppose) Broadcom has released info on their chip.

    General:
    I don't really care if a board uses Broadcom, Allwinner, Atheros, etc, as long as their is a Linux OS for it that I can learn so I can use it for what I want.
    For my current project (which has a few uses) I want something cheap that I can customise. The WR703N fills that void.
    I have a MK802 II (Allwinner A10) that I want to play with - perhaps just to broadcast wifi videos to my TV ??? The later dongles use quad cores.
    I have a Pi B which I would like to ultimately get XBMC running on, but I also want to record TV programs on it for later viewing. My son is doing this and I have too many projects.
    And I have a TV dongle for using SDR, again when I get time.

    Meanwhile, I am playing with the Prop and P2.

    WR703N
    Cannot buy locally, but no problems buying either on eBay or Aliexpress. Many suppliers with free shipping. WR702N and MR3020 are also readily available.
    My current problem is just configuring the wifi to work with the newly loaded firmware, and also the Linux learning curve. No problems with the WR703N though.
    Instructions for loading the firmware etc are different which causes some confusion. You cannot just follow one writeup to get it done (or I haven't found one). But with lots of reading, it becomes clearer. I will post my wifi info in another post - its just my lack of understanding from getting this to work.

    BTW I am pleased they released the Pi B+. I have a group of pcbs that I had been designing and were running very late. I was almost ready to send them off when I read about the new B+. This means I have a redesign to do on my boards to fit the new board specs.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-15 23:06
    Hi all,
    Well, I seem to appreciate Cluso's vision and I like the minimalist, headless Linux... adding a wifi bridge to it and it is very appealing to me.

    And I have always had doubt that 2,000,000 sold converts directly to the same number of users. I took exception to PropForth when another poster claimed X amount of downloads directly converted to the same amount of 'engineers' actively developing PropForth.

    =================

    As far as my progess, the soldering iron has been put to use. A serial interface is being constructed. And I have even been working on getting that Reset toggle wiring included.

    I certainly do need to load firmware at this point. I just mention what is in the shops here as a bit of 'newsy color' for DIYers. Shopping EBay and Amazon are not easy for me.. costly shipping charges and many vendors do not ship to Taiwan.

    ++++++++++
    Okay I get it! Gedit requires resource that are not there. Thanks for pointing this out as I am indeed learning. I guess that implies that SimpleIDE may not be supported either and that loading Propeller binaries will just have to be at the Command Line.

    ++++++++++
    Why reject the Raspberry Pi?
    Well to me it is just another Linux machine with Ubuntu or Mint or whatever on it.

    I have several that I can learn on.. paid for and not requiring either an HDMI monitor or adapter (I don't have an HDMI TV.). I really do not want more keyboards and monitors on my desk.

    In all honesty, I haven't found much need for the CubieBoard either... the media juke box concept has hit some snags as www.mediayou.net has apparently become less Linux friendly, gone over to Window's drivers.

    I do most of my computing on a notebook computer and wifi certainly cuts through having a tangle of wires that a normal LAN would demand.

    Why I like the OpenWrt devices?
    Headless, minimalist Linux with routing services seem more attractive to me personally. And they fit into my educational beliefs (You have to start slow and small and help the learner notice the fundamentals. You can not just dump them in the deep end of the pools and say, "Swim".)

    I tend to believe that even today, learning basic UNIX before dealing with all the GUI and multi-media stuff is a reasonable educational approach. I have doubts about people who just jump on an educational bandwagon and say 'Buy this'. Teachers tend to have to scratch their heads and figure out how to make the stuff fit into a real slot in a real curriculum, while all the glory goes to the 'latest educational advance'.

    ++++++++++++
    Progress report on the MR3020 build.
    I did open the case, removed the board, soldered a 4-p header in place.. but hit a snag. Loading the firmware could have come first, but I just haven't gotten around to that.

    Unlike the WR703n, the MR3020 provides holes for a 4 pin header to get Tx and Rx with Vdd and Gnd. I soldered a straight up one in place as that is what I saw in a picture. It seems if you do that, you can no longer close the case after a cable is plugged in. I am unhappy with that.

    And so, I have to go back and remove the installed header and use a 90 degree on to get the results I want.

    I am not providing a level shifter. I will attempt a direct TTL RS232 connect to the Propeller's pins 30 and 31.

    ========
    I am also curious if Cluso has located the serial port via using a Terminal program. He should be able to use Putty (installed inside the WR703n) to get out to a Propeller now that the firmware is installed or do some other means.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-16 01:06
    The minimal headless Linux is a great idea. There are many ways to achieve that, hacking on routers is one, using ready made systems, of which the Pi is only an example, is another.

    Yes, two million sales is not two million users. Same applies to any other product. So?

    SimpleIDE won't be running on these routers. However that does not mean your Propeller loader could not have a GUI interface. You have a WEB server on the router. Just create a WEB page that it can serve that enables sending binaries to the router and calling up the loader to get them into the attached Propeller. Said WEB interface could also relay serial communication from the Propeller to a terminal display in the users browser. Bingo, a remote GUI for your Propeller!

    Yes the Pi is just another Linux machine running Debian or whatever. That is the point. Wasn't it the "first designed for Linux computer" of any kind that consumers could buy. Hardly "just another" more a historical landmark.

    The Pi does not require an HDMI monitor to use it. Neither do they require keyboards and mice. I don't know why you persist in saying this after I have corrected you a hundred times already. They are "minimal headless Linux", just as you ordered.

    You seem to have doubts about the educational approach of the Raspberry Pi Foundation. Introducing young children to computing via hacking on a router seems like a total non-starter to me. I suspect that some of them would be up for it if they saw a reason to get into all that irrelevant detail. After all they used to hack and crack games in the past. In general a more organized and scalable approach seems a better idea.

    You are also suggesting that the Raspberry Pi Foundation is only saying "Buy this" and nothing else. Whilst yet again ignoring the enormous amount work that goes on behind the scenes to support the Pi with educational materials. Again this is a falsehood you persist with. It almost seems malicious. I don't know why. It's an insult to all the good people involved with the Pi project.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-16 04:00
    Progress report on the MR3020 build.
    I did open the case, removed the board, soldered a 4-p header in place.. but hit a snag. Loading the firmware could have come first, but I just haven't gotten around to that.

    Unlike the WR703n, the MR3020 provides holes for a 4 pin header to get Tx and Rx with Vdd and Gnd. I soldered a straight up one in place as that is what I saw in a picture. It seems if you do that, you can no longer close the case after a cable is plugged in. I am unhappy with that.
    Can you remove the plastic mount part of the 4pin header ?? Often they are easy to remove especially when the no of pins is small. If you can do that, then you can heat each pin and push it thru the pcb and then cut the extra length of the pin.
    What I often do is solder the pin on with the plastic and short end on the topside, leaving just a tiny gap between the plastic and pcb for a jewellers screwdriver. Once they are all soldered I cut the pin on the solder side, then remove the plastic on the topside. Makes a much lower set of pins. Or, if I don't cut the pins, I have pin headers to both sides of the pcb.
    I am not providing a level shifter. I will attempt a direct TTL RS232 connect to the Propeller's pins 30 and 31.
    ========
    I am also curious if Cluso has located the serial port via using a Terminal program. He should be able to use Putty (installed inside the WR703n) to get out to a Propeller now that the firmware is installed or do some other means.
    I haven't looked at the serial since I loaded the new firmware. It was working prior to this so I see no reason why it wont work now.
    No time today on the box.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-16 07:29
    Hi, I am in the busy part of my week's teaching .. so I am running around in 33 degree heat most of the day. But I am planning and researching how to reach our first Milestone.

    I tried previously to end all this debate about the worth of the Raspberry Pi Foundation.
    It seems they are following through with eduction of users within the U.K. But I am not clear about what is going out globally.
    I do have my doubts with any institiution that enters education with a lot of razzle-dazzle and riding a wave of crowd-sourced predecessors and promotion of a noble cause.

    Education is my regular job via teaching English. And people that promote teaching and learning ESL often don't deliver as much as they sell, including major universites in the USA and UK. Thus, I personally have listened to a lot of promotions of education over the past 20 years that really haven't delivered.. including major publishers such as Oxford, Cambridge, and MacMillian.

    I just looked at the board and decided to get something else. It is not me that claims 'better support' because of 2,000,000 users. It wasn't me that tried to get people to buy a second board to be given to a needy learner. I am satisfied to muddle along with what I have and other support communities without all that other stuff.

    Can we set asode the Raspberry Pie and just deal with the WR703N and its cousins - the WR702 and MR3020 in this thread?
    Of course all talk of Linux is welcome.


    I am not trying to belittle the R-Pi. I just push back when you jump in and say this project is a waste of time and should be done on a Raspberry Pi. I happen to find this alternative rewarding and I am enjoying the hunt for parts, the shop talk, and learning to get a better understanding of Linux without X-Windows.


    Regarding the build of the MR3020.. I will try to provide photos of what is going on for others to refer to.

    1. I think I can easily use solder wick to remove the 4 pin header and replace it with a 90 degree header. Not much new to that.

    2. Putty is likely the easiest way to log in via SSH and over wifi. That will get you into the WR703N.

    3. See if you have an installed version of minicom, by inputting 'minicom' at the prompt. If you do, that will be your link to your RS232 to the Propeller. If not, it looks like OpenWRT has compiled binaries in the past and since this is a text-based serial termial of small size, it is ideal for loading into the WR703N.

    If you so desire, there are lower level ways to use a serial, but I am not up to speed on all that entails. I am looking for a binary of Minicom for the Antheros CPU, or for a complete ready-to-compile package for Minicom. PuTTY is not appropriate.

    +++++++
    I am enjoying the construction side of things. No big disaster in back-tracking to make the whole package come nice together.

    Rereading the power requirements for the WR703N are very very impressive. Apparently it will do fine as low as 3.3v. Without extras, 0.6 watts while operating. I am unclear if it actually is a 3.3v ro 5.0v device. It actually may be swinging through that range without voltage regulation provided internally.

    When you have a device with HDMI, Keyboard, and Mouse you have quite a lot of additional load. Mice and Keyboards can requre 500ma each at 5V even though many claim they require less. It would be hard to get by with less than 5 or 6 watts with my Cubieboard. Not sure how the comparision works out if one adds a wifi dongle and never connects an HDMI, keyboard, or mouse.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-16 19:32
    Loopy,
    Perhaps you might think about using a 5 pin ra header - remove the 5th pin from the plastic and reinsert rotated 90/180 degrees or cut the bent section off. This can be used later for the reset gpio pin (for the prop).
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 00:55
    Hi,
    Yes indeed.
    I have been thinking of a 5 pin header instead of 4 pins... but there are only 4 holes on the board. So some creativity comes into play with getting the GPIO to the 5th pin.

    A bit of reading indicates that there are to available GPIO pins that only require an SMD resistor (that is pulling them to ground be removed, and then a bit of 30 gage wire wrap wire can be used to provide that 5th pin.

    But it seems to me that rather than having the GPIO go directly to the outside world, I might desire to insert a transistor so that the Reset line has more drive and so that this transistor would take any abuse from shorting or reverse polarity in the future.

    So that adds a bit more to fit into the scheme.

    ===========
    Problems with RS232 on router boxes in general.
    All these routers easily set up RS232 going into them to log on as an Administrator, and even include the SSH features for security over RS232, wifi, and LAN.

    But here we desire a simple RS232 going out to provide a variety of serial services. I don't want to use a USB setup for outgoing RS232 via conversion, so I am having to do a bit of research.

    At start up, the Linux 'init' starts up the serial ports with default settings for an incoming Admin console.
    In Linux, that process is 'agetty'.

    But what I desire is to bridge the LAN and/or Wifi login to output. 'agetty' may get all the serial ports ready to listen to incoming logins, but I am unclear if and how it can be called upon to output unsoliticted messaging..

    This might be as easy as piping text to the desired serial out, or it might be more involved.

    My first and preferred way to go is to load Minicom inside the OpenWrt and I am looking at that. This would allow me to have an interactive mode with Forth on the Propeller or a BS2. I just haven't yet found any sites with a clear explanation of deploying Minicom inside the OpenWrt Linux.

    My second choice is to do something lower level. I guess this would be necessary for downloading Propeller binaries. It is a serial port configuration that excludes human spontaneity. So it can be a binary, or a batch file, or a combination of these elements.

    Everything is pointing at learning to compile GCC on the Antheros cpu. And learning to include these binaries. This may or may not require a custom compile and reload of firmware.

    While I found available GPIO for the device, they were demonstrated to add an I2C port. I am going to have to come up with different code for the Reset.

    I2C may be a useful additional for you. After all, you connect I2C to the Propeller for control, or you can connect I2C to a wide variety alternative chips. But I really want the asynchronous serial to allow me to use the WR703N as a communications conduit.

    Here is a link that may allow you to get an idea of your asynchronous serial port activity. My guess is that you will only have ONE phyicall stty0, and maybe a bunch of stty# that are virtual (in the /dev listing).

    http://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-to-the-serial-console/
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-17 01:36
    I have my WiFi working back to my laptop. But its not working to the internet yet.
    I had a typo in my /etc/config/network so no wonder it didn't work!

    Here is my /etc/config/wireless
    [EMAIL="root@OpenWrt"]root@OpenWrt[/EMAIL]:~# cat /etc/config/wireless
    config wifi-device  radio0
            option type     mac80211
            option channel  11
            option hwmode   11ng
            option path     'platform/ar933x_wmac'
            option htmode   HT20
            list ht_capab   SHORT-GI-20
            list ht_capab   SHORT-GI-40
            list ht_capab   RX-STBC1
            list ht_capab   DSSS_CCK-40
            # REMOVE THIS LINE TO ENABLE WIFI:
    #       option disabled 1
    config wifi-iface
            option device   radio0
            option network  lan
            option mode     ap
            option ssid     'My703'
            option encryption none
            option key      'me'
    
    Where the instructions differ to what I have put are...

    option network lan (should be wan)
    option mode ap (should be sta for managed client mode)
    option ssid 'My703' (I added the quotes. This is what my router uses as its ssid for the wifi. Should it be the ssid of my server wifi ???)
    option encryption none (should be psk. Should it really be psk2 ???)
    option key 'me' (I added the quotes. Is this the password to log onto my server wifi ???)

    I am going to try the changes and see if the 703 will then logon to my server wifi (Its a hotspot gateway to mobile data).
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-17 01:38
    Loopy,
    Cant you use the serial ttl port that you added ? My understanding is that this is the primary control port and is necessary if all else fails. I have already monitored my 703 from this port, although I haven't connected since I downloaded OpenWrt.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-17 01:48
    Loopy,
    Everything is pointing at learning to compile GCC on the Antheros cpu. And learning to include these binaries. This may or may not require a custom compile and reload of firmware.
    You are not going to be able to install GCC on the router. Or rather if you did I suspect it would not run due to memory constraints.

    What you need is a GCC that runs on your PC and generates code for your routers processor. A "cross-compiler". In the same way you use a GCC that compiles to Propeller code on your PC, you don't run propgcc on the Propeller.

    You might be able to use the ARM cross compiler package that comes with Ubuntu "gcc-arm-linux-gnueabi" or you might have to find a ready made cross compiler on the net some place. If not you will have to build a cross compiler on your PC, this is a bit of a turd ball of a job which I have always had difficulty in getting right.

    Perhaps the open router pages have instructions for doing this.

    With the cross compiler in place you can build minicom or whatever for the router on your PC.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-17 02:07
    Looks like OpenWRT has your cross compiler / tool chain covered: http://wiki.openwrt.org/about/toolchain?s[]=buildroot
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 05:20
    Thanks, I was looking for their recommended cross-compiler and tool-chain. It would be silly to use something else.

    It seems this project is headed for a compile of a completely custom firmware image to provide services for the Propeller. See the discussion below on squashfs as to why. I was aware that this might be required, but am willing to pursue the challenge.

    Linux has a lot of free documents, maybe more than one would wish for.
    I have been reading the details of serial ports in the Linux Systems Administrator's Guide... at least it explains 'init' and the boot process in a pro forma way.

    Squashfs is a special file system to adapt to not having a hard disk... purely solidstate and a much later bit of Linux history.

    http://squashfs.sourceforge.net/

    Herein lies the dilemma. Squashfs is a Read-only File system, not for in and out files. You really need to add ex-root to have the kind of file system that a Raspberry Pi or others might provide.

    So, to actually add in Minicom or other software; some significant revision of the source code to allow it all be written to firmware must take place.

    I am willing to try. I need to study ex-root and the installation process for that as it may be the most flexible way to resolve the Read-only barrier.

    Essentially, squashfs provides a boot-image and apps that can be loaded into the RAM at run-time if necessary. It also is very secure from outside attack. Whatever else is been done is in volatile RAM and disappears at every reboot.

    I suppose files to be transferred can be buffered in RAM, if they are small. But it would be wiser to have them buffered in the ex-root set-up in case of glitches forcing you to scramble to reload binaries for the Propeller and all the apps that are not in squashfs.

    BTW, TP-Link claims that it no longer supports the WR-703N -- just the WR702N and MR3020.

    At one time TP-Link seems to have provided the source code for the MR3020 in compliance with its GNU license requirements, but the link to download it is now dead and no mention is provided at TP-link.

    So, OpenWRT source code is the only place to start any custom modifications.

    Minicom may need to be downsized to exclude its support for XModem, YModem, ZModem, Kermit and some other services. If it goes into the OpenWrt firmware binary and is intended for just the Propeller, all the additional service might be unnecessary.

    I need to get the OpenWrt loaded and to get a listing of their image of BusyBox actually provides... every user has the option to exclude items that seem unnecessary. Just maybe therer are serial services in BusyBox that could work in lieu of Minicom. IN Particular, getty, stty, telnet, and telnetd are listed in BusyBox.

    I have wanted to become more familiar with BusyBox for a long time.


    http://en.wikipedia.org/wiki/Telnet
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 06:49
    While XModem and Kermit might be useful with the Propeller2, they are NOT currently supported. XModem, YModem, and ZModem would be the smaller code choices for Propeller1 and Propeller2. Kermit is larger.

    While looking for a copy of Minicom source code, I located Picocom. Picocom seems to be a simpler, smaller solution, and easier to deploy.
    Picocom does not have Kermit, but it still supports X-modem, Y-modem, and Z-modem which are a smaller set of file transfer protocols. Kermit is a big addition.

    http://code.google.com/p/picocom/

    So for now I am abandoning Minicom and focusing on directly installing Picocom withing the squashfs binary. It seems to be a better choice.

    I have also actually located a 2012 thread in OpenWrt Forums that claims a successful Picocom install on an MR3020. So there is a plan to follow.
    https://forum.openwrt.org/viewtopic.php?id=33429&p=4

    I am just crossing my fingers that this will quickly move forward. There appeares to be a hang in disconnecting the FTDI RS232 to USB with picocom. But I am not attempting to use that RS23 conversion. So my attempt may just work cleanly. BTW, I have a gut feeling that the FTDI USB-to-RS232 driver may just demand so much RAM for buffer space that when the wifi is started, the RAM crashes. So I am going to start out without installing any USB to RS232 drivers.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-17 08:21
    Loopy,
    It seems this project is headed for a compile of a completely custom firmware image to provide services for the Propeller.
    No not really. If you have a working system you should be able to cross-compile programs on your PC and then put the executables onto the router via FTP or SCP.

    I would even advise against creating a custom image because when the guys upstream update it you have to do all your work again if you want to follow along.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 08:37
    Well, I have located picocom, microcom, minicom, and coreutilis-stty for the WR703 and MR3020 in the ar71xx packages depository.
    And, OpenWrt seems to only support a custom cross-compile as the means to load these (unless I get that ex-root setup installed)

    Oddbitcollector and myself seem to agree that having this work without the ex-root solution is what we would prefer.

    So it seems that the squashfs is requiring such an approach. We can always just provide the Firmware to any Parallax user that wants to flash it.
    It does seem that FTP would be needed for Propeller binaries. But for a 32K binary, that might be able to just reside in RAM. I will take a look for a package to support FTP. There are only 32MB of RAM in the stock unit.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-17 16:59
    I needed to think about what I am trying to achieve.
    So I drew a block diagram of my setup...

    Clusos WiFi.jpg

    Currently I can logon from my laptop to WR703(1) via WiFi and Putty SSH as root. This is a direct connection from my laptop to the WR703(1) via WiFi.
    These are the parameters...
    config wifi-iface
            option device   radio0
            option network  lan
            option mode     ap
            option ssid     'WR703(1)'
            option encryption none
            option key      'me'
    
    The windows network connects without requiring a password !!!
    Using a browser, I can connect as root with the root password, via 192.168.1.1

    What should I do next???
    1. Can I create a script to turn a GPIO LED on and off and run it from root? If so, how do I do this?
    2. Can I change the WR703(1) settings to make it part of the 'HOT' WiFi network? What settings (WAN, STA, 'HOT', PSK (or PSK2?), 'SPOT')?
    ... With my laptop now on the 'HOT' wifi network, can I connect to the router WR703(1) via 192.168.1.1 to root?
    ... Can I then run the script described in 1. above?

    heater, does this make sense???
    570 x 269 - 24K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 21:45
    Hi,
    I really am NOT clear on GPIO pin toggling. I have yet to locate example code for that.

    And so everything I am doing is primarily focused on the setup you have as WR703(2) to be first deployed without the Reset.

    Encryption to and from the WR703 devices and your wifi computer is available. You just haven't gotten it set up to be active. To me this is a side issue at this point. I know it is there and likely works quite well. So I am look on how to add the missing pieces.

    Is this HOT network a Microsoft feature? Is it just a neat name for one wifi link between two devices? I suspect that you will have to have each WR703N log in to your LAPTOP individually ... at least for now.

    ONE WR703N could be set up as a Wifi router that is restricted to recognized other WR703N devices. And it could either repeat traffic to the laptop via Wifi or LAN. Linux has a rather sophisticated set of router resources, but you do have to learn how to work with all that the router resources have to offer -- both for wifi and LAN.

    In sum, there is a lot to be studied about Routing if you desire to have a lot of these devices working together. It is a big topic, but there is a lot of free literature.

    And, I am just working on a less ambitious project for now. One Propeller connected to one WR703N or MR3020 with eventual GPIO access. Heater says the GPIO is easy to program, but I find it challenging. Either I am just not as smart and as savy, or I am more pragmatic about these things.

    I would love for someone to just jump in and hand me a similar completed project to work from, but it looks as though that isn't going to happen. If you desire a sophisticated Wifi network in Linux, you are likely going to have to learn quite a bit about Network Administration in general and in Linux specifically.

    ++++++++++++++
    For others, a Hot Spot is a special wifi router application that includes a Radius server to hand out login rights and to track the identities of these people. In many countries, the governments require this record keeping to prevent illegal activities by anonymous users of wifi hot spots (Taiwan certainly does, all my wifi activity is tied back to my cell phone and I had to provide my passport to get that.).

    Are you using the term 'hot spot' in a loose sense or a formal sense? IN the loose sense, it is just a centralized router on a private network. IN the formal sense, you are dealing with your local government and telephone company to provide a database of traffic and user identities.

    IOW, your 'hot spot' may not really be a hot spot at all. I have in the past looked into creating a router for true hot spot services, but gave up on it. There are a lot of good devices that are already available for very reasonable prices that combine the hardware and software. And the governments would rather you use those.
    +++++++++++++++
    I am presuming you are in Windows and desire to add encryption to your WR703N.

    A. You have to select which one of several encryption methods you desire on the WR703N

    B. You have to locate a set up tutorial for that specific encryption in OpenWRT

    C. After the WR703N has been properly set up, Windows will locate the device, but demand you provide new login proceedures that can be either manual or automated.

    I have done this with my other wifi router as all my notebooks - both in Windows7 and Linux - work behind encryption


    http://lartc.org/howto/
    http://www.tldp.org/LDP/nag2/nag2.pdf
    http://wireless.kernel.org/


  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-17 23:20
    @Cluso
    I have to admit I have been ignoring how to control the GPIO, but it seems to actually be available without having to add C code and recompiling the firmware.

    Here is the OpenWrt Wiki on how to use it.
    http://wiki.openwrt.org/doc/howto/mmc_over_gpio
    You can explore immediately with what you have. Let me know if you are successful.

    There is even a shell script example (I guess it uses ASH). You should be able to connect an LED and get it blinking. I am very happy to find this as it make everything easier. It seems similar to what Heater was trying to explain (I guess.).

    Also there is the okpg package system to install packages without a firmware compile. But it seems to me that you would have to do this repeatedly at a keyboard if you power down the WR703N. And there are kmod modules for I2C, SPI and other uses of the GPIO. These also may remain active as long as the WR703N is not powered down.

    That might means that everything you desire can at least be explored and tested without a new firmware compile. If you like what it provides, you won't need another firmware image.

    A cross-compile cannot be done in a Windows OS, as the Windows C cross-compiler is not supported by OpenWRT's rather large and non-standard Buildroot.

    Slowly I am locating more of the bits at OpenWRT.

    http://wiki.openwrt.org/doc/hardware/port.gpio

    http://wiki.openwrt.org/doc/techref/opkg
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-17 23:24
    Hi,
    I really am NOT clear on GPIO pin toggling. I have yet to locate example code for that.

    And so everything I am doing is primarily focused on the setup you have as WR703(2) to be first deployed without the Reset.
    I have seen code for this. Just need to find it again.
    Encryption to and from the WR703 devices and your wifi computer is available. You just haven't gotten it set up to be active. To me this is a side issue at this point. I know it is there and likely works quite well. So I am look on how to add the missing pieces.
    Agreed
    Is this HOT network a Microsoft feature? Is it just a neat name for one wifi link between two devices? I suspect that you will have to have each WR703N log in to your LAPTOP individually ... at least for now.
    My hotspot is just my tablet acting as the internet to wifi router. I just named (ssid) it 'HOT' rather than using the long name I use here.
    It is the same as an iPhone acting as a hotspot (router).
    ONE WR703N could be set up as a Wifi router that is restricted to recognized other WR703N devices. And it could either repeat traffic to the laptop via Wifi or LAN. Linux has a rather sophisticated set of router resources, but you do have to learn how to work with all that the router resources have to offer -- both for wifi and LAN.

    In sum, there is a lot to be studied about Routing if you desire to have a lot of these devices working together. It is a big topic, but there is a lot of free literature.
    I am not sure how to get the laptop to talk to the 703 while looking like it is going out over the internet. ie not laptop-wifi to 703-wifi direct.
    And, I am just working on a less ambitious project for now. One Propeller connected to one WR703N or MR3020 with eventual GPIO access. Heater says the GPIO is easy to program, but I find it challenging. Either I am just not as smart and as savy, or I am more pragmatic about these things.
    I will go looking for the example.
    I would love for someone to just jump in and hand me a similar completed project to work from, but it looks as though that isn't going to happen. If you desire a sophisticated Wifi network in Linux, you are likely going to have to learn quite a bit about Network Administration in general and in Linux specifically.

    ++++++++++++++
    For others, a Hot Spot is a special wifi router application that includes a Radius server to hand out login rights and to track the identities of these people. In many countries, the governments require this record keeping to prevent illegal activities by anonymous users of wifi hot spots (Taiwan certainly does, all my wifi activity is tied back to my cell phone and I had to provide my passport to get that.).

    Are you using the term 'hot spot' in a loose sense or a formal sense? IN the loose sense, it is just a centralized router on a private network. IN the formal sense, you are dealing with your local government and telephone company to provide a database of traffic and user identities.

    IOW, your 'hot spot' may not really be a hot spot at all. I have in the past looked into creating a router for true hot spot services, but gave up on it. There are a lot of good devices that are already available for very reasonable prices that combine the hardware and software. And the governments would rather you use those.
    See above. It's just my phone equivalent hotspot, but I am using my Xoom table for this and it is connected to the mobile data network. So, its equivalent to a private master router and gateway to the internet. Nothing special.
    +++++++++++++++
    I am presuming you are in Windows and desire to add encryption to your WR703N.

    A. You have to select which one of several encryption methods you desire on the WR703N

    B. You have to locate a set up tutorial for that specific encryption in OpenWRT

    C. After the WR703N has been properly set up, Windows will locate the device, but demand you provide new login proceedures that can be either manual or automated.

    I have done this with my other wifi router as all my notebooks - both in Windows7 and Linux - work behind encryption


    http://lartc.org/howto/
    http://www.tldp.org/LDP/nag2/nag2.pdf
    http://wireless.kernel.org/
    I am not worried about the encryption. The only part I am unsure of is if I need to use PSK or PSK2 for the setting and I can just try it and see what works. These just replace WEP etc.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-18 00:12
    Here is the beginning of my propeller loader that runs on the Raspberry Pi. It uses the Pis UART and a GPIO pin to do the Propeller reset. It is a clone of the loader that comes with propgcc that I started to modify for use on the Pi.

    https://github.com/ZiCog/pi-propeller-load

    If you go into the src directory you will find gpio_sysfs.c and gpio_sysfs.h that drive a GPIO pin by reading and writing from /sys/class/gpio. A quick read of the code will show you that it does very simple file reads and writes that you could do manually from the command line with "cat" and "echo", or in a shell script.

    gpio_sysfs can be compiled as a program by itself for testing purposes:

    $ gcc -o test_gpio_sysfs -DTEST_GPIO_SYSFS gpio_sysfs

    Of course you will need to find out what GPIO pin you can use and change the PIN definition accordingly.


    This page shows how to access GPIO on the Pi very nicely. He uses shell commands and C++ http://hertaville.com/2012/11/18/introduction-to-accessing-the-raspberry-pis-gpio-in-c/



    Edit:

    You can fetch my loader with the command:

    $ git clone https://github.com/ZiCog/pi-propeller-load.git
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-18 01:43
    @Heater
    I would like to point out to you that the Raspberry Pi is significantly different.

    A. It uses BerryBoot in squashfs to load a Linux OS image from an SDcard.
    > This means that the write only aspect of squashfs is not affecting how the Linux OS is configured and reconfigured.

    B. The Raspberry Pi neither provides Wifi or a Wifi Router service directly.

    ++++++++++++++++

    If you don't understand the WR703N or the MR3020, offering Raspberry Pi applicaitons herein is merely contining to tout your personal preferences.

    I am doing a lot of research and study to learn exactly how OPENwrt and these devices can be useful to the Propeller.
    I think I have already made it clear that this is NOT a debate about the superiority of Raspberry Pi.

    So please allow others to explore projects and topics that are NOT part of your strong personal preferences.

    And please post your Pi-Propeller Project links in their own thread where anyone interested doesn't have to trash someone's elses project.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-18 02:21
    Loopy,

    Grrr...

    Don't be so frikkin sensitive about the Raspberry Pi. I did not say anything about the "superiority of the Raspberry Pi" you simply imagined I did and flew off the handle. You have failed to understand what I offered there and how it might help you with the router project. Perhaps that is because I did not spell it out and just assumed it was obvious. All that underlined bold text shouting at me that I don't understand is terribly rude and makes me want to not bother trying to help you.

    Now for the benefit of your understanding:

    1) The router uses and ARM SoC. The Raspi uses an ARM SOC. ARM SoCs have GPIO and Linux has drivers and interfaces for those GPIO. These interfaces are the same accross many ARM SoC based machines. Raspi. Beagle, Cubie etc. I am hoping that your router firmware adheres to this "standard" and has the same GPIO interfaces. If it is running a modern kernel that should be a safe assumption.

    2) The software that I offered is not Raspberry Pi specific. Despite it's name. It will work on any ARM SoC based machine running Linux. Raspi, Beagle, Cubie, etc. My hope is that the router can run this code if it follows standard practice. In that way you have a Propeller loader that is usable on the routers.

    3) The article I linked to describes how to use these standard interfaces from the command line or shell script. Yes, I know, it's a Raspi article but the same methods should work on other ARM SoC systems.

    4) I don't care about squashfs. True it makes life a bit tougher because it is read only. You have two ways to go there I think.

    a) Figure out how to build your own squashfs images and add the router executables and other files to it.

    b) Set up a tiny ram disk area that you can download the code into. Does the router image support ram disks?

    Just now I can't see any other way to test software on the routers.

    5) Saying the Raspi does not support Wifi or Wifi routing is just plain dumb and totally beside the point. But anyway it certainly does support WIFI via USB and it certainly does support whatever routing software you can get for Linux. Yeah, OK, you have to buy a five dollar USB WIFI dongle. See for example these instructions: https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview Please note again that the instructions given there are again not Raspi specific. They are generic Debian setup instructions applicable to many other Linux systems.

    Please stop shouting rudely and blindly jumping to conclusions:)
Sign In or Register to comment.