Author Topic: waiting for socket connection  (Read 4175 times)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for socket connection
« Reply #15 on: April 27, 2018, 08:41:04 AM »
vk3jap,
I thought your problem is getting the app installed.
But ok...

The default serial port setting is /dev/ttyAMA0 which is the GPIO serial pins. This is enabled during initial setup (to free it from the bluetooth if you have a Pi3, and system console taking it over).
It the GPIO ttyAMA0 serial port is used by something else, opening it with minicom or another client will produce no output.
You can always just plug your Moteino into the USB port of your Pi and then that will produce a new serial port, something like /dev/ttyUSBx, then you have to set that in the Gateway settings and restart the Gateway app. If you have the regular Moteino then just add an FTDI-Adapter to it to make it USB compatible, or you can use a Moteino-USB.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: waiting for socket connection
« Reply #16 on: April 27, 2018, 09:27:24 AM »
Are you using the more via serial or USB..?
I tried both, started with USB since I didn't have to check PRI pinout, now I'm without usb/serial converter. But all that was changed was where gateway looks for data (ttyAMA0 and all others)

vk3jap

  • NewMember
  • *
  • Posts: 41
  • Country: au
Re: waiting for socket connection
« Reply #17 on: April 27, 2018, 10:41:15 AM »
vk3jap,
I thought your problem is getting the app installed.
But ok...

I've spent the best part of this chasing my tail. I fix one thing, something else doesn't work. I get the serial port working, then I'm stuck with waiting for socket..I fix that, the serial port doesn't work. I get both of those working and then I get new nodes appearing. I go to the mote-setup web page, and I'm prompted with two options...try this, or, try that..

I know this is not a professional project as such but it so is..what you have done here Felix is just awesome..it really is.

I feel the software side of things let's down the hardware side, but maybe your interest is more in the hardware. For my mind you need to be quite experienced in Linux and coding to get this working.

I feel with a little further attention to detail and simplicity it would be super awesome and almost something which would be a viable full business (understanding this is not your intention).

What's required really, I feel is that for each model of rPi there is a clear simple (no options, not referring to forum discussions) set of instructions to follow.

Something like..
Buy this Pi - link
Buy this mote.. suggest USB if that is easier to get linked to the Pi.
Use this image - direct link (from your site)
Use this .ino for the RX gateway Pi. - link
Use this .ino for the your first Mote..as a tester.
..no ambiguity.

I'd be happy to buy the latest few models of Pi for you to have this on.

Please understand this is me venting some frustrations and sharing some ideas.. it is not meant to seem hostile at all mate.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: waiting for socket connection
« Reply #18 on: April 27, 2018, 11:21:33 AM »
Didn't you have this all running already?

PI3B is a big change in software and hardware, it might not work because of that

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for socket connection
« Reply #19 on: April 27, 2018, 11:44:28 AM »
vk3jap,

I haven't tried this on Pi3B+ yet (latest pi as of now).
But it all works fine on the Pi3 (which inludes the wifi+bluetooth).

@vk3jap:
I can offer to sell a package where I buy the Pi, add the hardware (2 moteinos or a MightyHat with ISP/battery backup and a moteino). Then I setup everything to a working point where if just powered, it will work, and the remote moteino would send in random data (the RandomNumbers sketch) or something like that, producing immediate node/graph in the Gateway app. Is that something you'd be interested in? If so let me know.

It might take me ~1 hour or more to do everything, and not sure of the cost (factor in all the hardware, plus the hour contract labor). Other options like a case and fancy stuff would take even more. So ... I may give it an hour or so to make this happen but you have to be "all-in", basically place an order. Might be a good exercise for me to nail down some practices and reduce that setup time for the future. I am usually really tied up in other projects and development that is not perhaps visible on this public site, but I always try to help folks out if I can.

vk3jap

  • NewMember
  • *
  • Posts: 41
  • Country: au
Re: waiting for socket connection
« Reply #20 on: April 27, 2018, 05:50:10 PM »
I went the the Pi 3b because it has onboard wifi. I had tried the previous models without onboard wifi and used a wifi dongle (USB) and it was problematic, not reliable - it would drop out and lose it's connection so I had to make a watchdog process and reboot it - that was crap! .. hence why I am running the 3B

@Felix .. sure, I'll go for that! this way when it arrives all I need to do is change the wifi details and we're good to go - perfect. I do think you should offer to sell this ad a sKU/package - it wouldn't take much effort at all on your behalf and I think it would reduce the entry complexity. When you build this for me can you please also make a copy of the flash image (with the 2 .INO files in it somewhere) and if I ever manage to stuff it up or have issues I can always revert back to this config - ie just download the flash image, re image my flash, boot, change WiFi details and presto, all working again.

I work in IT and am doing Pi / Arduino classes.. spreading the word, I would LOVE to be able to say.. Buy Felix's stuff as opposed to sparkfun etc which is what I say at the moment. I can really see a good market for your gear with IoT.


Didn't you have this all running already?

PI3B is a big change in software and hardware, it might not work because of that

No Luka - never did. Had various bits and pieces working but, with the 3B I have never been able to get 'it all working' despite spending ages on it.
« Last Edit: April 29, 2018, 10:53:50 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for socket connection
« Reply #21 on: April 29, 2018, 10:58:31 AM »
vk3jap,
Ok great, thanks for the feedback.
What I need to know is your preference for the hardware package.
On the Pi side I might go with the 3B (not +). Not sure yet. But it would include a PSU and SD card. Optional stuff is the ATXRaspi or MightyHat but they are quite separate products. But I guess I can set them up for those who want these bundled.

On the subghz RF side - you'd need at least a pair of Moteinos or equivalent. One tied to the Pi and act as the Gateway and another as a test unit. Then you add more as you wish.

They would be loaded with generic passwords, or maybe you can specify those during checkout or at the product page when ordering. The sketches would also have generic RF settings and the generic "sampleEncryptKey", and you can then program them yourself.

Does that sound reasonable or close? Anything else I'm missing?
Anyone else have any suggestions/input/requests?

vk3jap

  • NewMember
  • *
  • Posts: 41
  • Country: au
Re: waiting for socket connection
« Reply #22 on: April 29, 2018, 04:37:26 PM »
Hey Felix,

awesome - I think unless it is a real issue your kit would be best to have the very latest Pi (3b+) - I mean who wants to place and order and get all excited at last years model of car etc.? so unless it is a real issue for some reason I'd like the 3b+ please.

reckon it would be a good idea to configure wireless - in the WPA supplicant file.. just make it YOURSSID and YOURWIFIPASSWORD  etc. By default there is nothing in that file so I have to google each time to get the format correct. I also think it would be good to have a simple way to set a static IP - maybe raspi-config can do that but if not perhaps have a file in there /etc/network.staticIPsample etc. Practically speaking, you're not going to want DHCP in production and I have messed around in the past with setting a static IP, especially over Wifi.

if possible I would use the standard Raspbian image - if it is without X Windows - add a file such that when someone types STARTX is comes back saying - "X Windows this package is not installed. On this dist/image whilst you can install it, it's really not designed to be installed - you should be able to just point your browser to http://1.2.3.4  and you'll get the moteino gateway login page."

Important to include the two sketches in the flash image of the rPi /home/pi/moteino/sketches/gateway and /home/pi/moteino/sketches/node - stick a readme file (really concise and simple) in each folder.  for Node - make that your random numbers, that seems like a good idea.

it would be handy at the top of ALL your files to have a Version number and release date for that version alongside. like..
- rPi Gateway Code package V8.11 Release Date 15 Apr 18.  (for the raspberry Pi files)
- Moteino_Gatway.INO V7.0 Release Date 1 Jan 18.  (for the main gateway Mote node)
- Moteino_Random_numbers.INO V6.01 Release Date 7 Feb 18. (for a first test Node Pi Mote)

I'll volunteer to help out with the files etc as mentioned above!


I'll go the ATXRapi and MightyHAt - I hadn't planned on using them but I like supporting your project so why not.

RF - 433Mhz and high Power (HCW etc) please.

Yep, sampleencryptkey is cool. At the end of the day I don't think you are making this for super gumbies just helping people get over that first hurdle. Making sure of course that that Network and Node settings will work on both Nodes (TX/RX) out of the box - ie no need to change that.

I'm in Australia - so if you could source power supply units which have an AU plug https://en.wikipedia.org/wiki/AS/NZS_3112 that would be good - just saves wasted parts and cost. If not easy to find just give people the option to buy it or supply their own - if they pick supply own make reference to the Volts, Amps and plug type requird perhaps. I know with the rPi low current causes issues.  Using a US Power supply with an adaptor sucks!!  These types are quite good - https://www.lindy.co.uk/images/multi-country-switching-power-adapter-12v-dc-3a-5-5mm-outer-2-1mm-inner-dc-jack-level-vi-p9373-7293_zoom.jpg you just put the final piece on as per your country. Perhaps have a US or International version OR supply your own (specs)

Important - Keep Copy of the Flash images used on your website. such that if people toast their production flash(tinkering!) they can just download and go again. Maybe even give them the option at checkout to buy 2 x FLASH's - one for use and one as a golden image should anything happen - reckon I'd buy that, not everywhere has great internet like you do in the USA :-|

reckon it would be a good idea to sell this a 'package' (if easy enough to do in your webstore) and give that package a version number and release date also - as, you will change the package makeup over time so if I order a package now and one next year I can see the difference. Maybe call is 'LowPowerLab Moteino Gateway Starter Kit) or something really obvious like that.

I'm excited - when do you think you'll have this good to go.?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for socket connection
« Reply #23 on: April 30, 2018, 10:16:17 AM »
3B+ sounds good, I haven't played with one yet so it's a good time to do it now.
For wireless - this would have to be done by yourself.
Same for the network stuff. I would simply use DHCP. I can't set a static IP since the subnet/network settings can differ. My goal is to ensure that you can plug in an ethernet cable, fire it up, access it over SSH perhaps - or just directly from a keyboard/LCD, and have the gateway running at the assigned subnet IP. I could include instructions how to reset passwords and set a static IP, or setup the wifi and change the Pi password etc. All that is very straight forward.

Any images and sketches would need to be downloaded and not hardcopied on the image itself. The sketches are very standard and have not really changed in years. The Pi image would be timestamped.

WRT powering options, its spreading too much and I would prefer to simply ship the Pi and not the supply in that case. I think any phone charger/cable can power a Pi.

RF options would be in the checkout.
The "package" will hopefully be ironed out as we go through this exercise.

It can be either the ATXRaspi or MightyHat (which includes a superset functionality of the ATXRaspi). The ATXRaspi is simply a convenient power/boot/reboot switch. MightyHat is that + a lot more, but it's more complex and will require a different sketch and GPIO serial. I would stick to the simple Pi+2 Moteino setup. Or the others can be optional upgrades.

I need to spend some time and figure out the exact hardware required, source the Pi+SD then set it all up and see what it takes. I will get the Pi this week and go from there.

Keep this thread going.

vk3jap

  • NewMember
  • *
  • Posts: 41
  • Country: au
Re: waiting for socket connection
« Reply #24 on: April 30, 2018, 10:24:04 AM »
Hmm... How's about let me try what I have in USB mode(as opposed to serial). I'll ping you back here. Don't guy buying anything yet.!

vk3jap

  • NewMember
  • *
  • Posts: 41
  • Country: au
Re: waiting for socket connection
« Reply #25 on: May 02, 2018, 11:15:05 PM »
OMG... finally, some success.

- Jessie Lite image
- pi 3B+
- connect via USB with the FTDI connector/converter.

@felix...mate, I think I'll just order a USB mote and be done with it. I would have thought serial would be easier but it seems not.!


Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: waiting for socket connection
« Reply #26 on: May 03, 2018, 08:44:16 AM »
As far as setting a static IP address...I use a linksys router and use the linksys app on my phone to reserve the ip address instead of just setting a static one. I have yet to have a problem with it