Skip to content

Instantly share code, notes, and snippets.

@danamlewis
Last active July 11, 2017 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danamlewis/ea2dc03304bd516895cb5e4600243524 to your computer and use it in GitHub Desktop.
Save danamlewis/ea2dc03304bd516895cb5e4600243524 to your computer and use it in GitHub Desktop.
Testing new wifi bootstrap script process

Thanks for your interest in helping test something new!

We have a new process for setting up OpenAPS that may be easier for people, but need some help testing.

What it does:

  • Finds and helps you set up your wifi automatically
  • Simplifies the old Phases 0 and 2 in the documentation to be more streamlined.

What you should do:

Thanks in advance for help testing!

@jyaw
Copy link

jyaw commented Jul 3, 2017

Works like a charm, Dana! Just used it to setup a new rig and all went smoothly! Just a few notes...

  • Would be nice to handle wifi SSIDs with spaces in them, perhaps just check the input string for double quotes on the beginning and end and remove them. I did have to run it twice since I have a ssid with a space in it. (I know, I know… just never got around to changing it long ago and it kinda stuck with me)
  • Got “sudo: unable to resolve host jubilinux” on installing openaps dependencies and when running oref0-setup but I checked and all the hostname stuff got setup correctly. Doesn’t seem to matter from what I can tell, but I wouldn’t think we should get those errors.
  • Might be handy to automatically create the .bash_profile? Would make quick verification/troubleshooting super easy.

@scottleibrand
Copy link

Agreed on supporting wifi SSIDs with spaces. Care to test that and PR in what works?

The "unable to resolve host" stuff should go away after rebooting onto the new hostname. We decided not to force a reboot until after we're done with everything, though, so that's an acceptable and harmless cosmetic bug IMO.

I think oref0-setup does all the .bash_profile stuff automatically. What are you seeing / referring to there?

@jyaw
Copy link

jyaw commented Jul 3, 2017

I'll see if I can get a minute tonight to look at the quotes/spaces thing....

(Referring to the bash_profile implemented in the docs). Well I guess on reboot I didn't see aliases available was all. I had to set up the aliases in bash_profile after installing dev the other day... wasn't aware it was supposed to do it automatically. Im probably just not aware of the expected behavior.

@thanksegon
Copy link

Agree with, jyaw, worked like a charm, I think. This is my first rig so the new script came just in time. But that also means I can't tell you if everything is working as expected, at least not yet. Once I fixed the wireless stability problem everything completed without error. I'm now going to get to know my medtronic pump, and take this all out for a spin. Thanks, Dana!

@thanksegon
Copy link

Dana, this being my first install I'm wondering where this leaves me in the build process? Your script completed without error, so what do I do next? Where do I pickup the build in the OpenAPS docs?

@danamlewis
Copy link
Author

@thanksegon you should have a basic loop going, but you'll want to head back to the main docs and pick up here for step 3 (watch the logs) and step 4 (change maxIOB and any other settings you want to customize): http://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-2/oref0-setup.html#step-3-watch-the-logs-required

@thanksegon
Copy link

Thanks, Dana. It looked as if the new script updated my azure site with the Nightscout OpenAPS features, yes? My NS site doesn't show these yet, so I'm wondering if I need to do anything further.

@gregtcm
Copy link

gregtcm commented Jul 4, 2017

The script was dropping out right before the last line. I'm guessing an error with iwgetid.
I added a sleep 10 before the line echo -ne "\nWifi SSID: "; iwgetid -r and that fixed the problem. My rig must be a little slower than most in getting a connection. Here is a little snippet of the error I was seeing:

Attempting to bring up wlan0:

Killed old client process
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/fc:db:b3:90:d3:00
Sending on   LPF/wlan0/fc:db:b3:90:d3:00
Sending on   Socket/fallback
DHCPRELEASE on wlan0 to 172.22.2.1 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
dhclient.c:2331: Failed to send 300 byte long packet over fallback interface.
[  150.948558] wl_android_wifi_off in
[  150.953066] wifi_platform_set_power = 0
[  151.339110]
[  151.339110] Dongle Host Driver, version 1.141.59 (r)
[  151.339110] Compiled in /home/robin/src/edison-linux-helper/edison-bcm43340 on Apr  4 2017 at 22:42:52
[  151.339288] wl_android_wifi_on in
[  151.354870] wifi_platform_set_power = 1
[  151.932621] F1 signature OK, socitype:0x1 chip:0xa94c rev:0x2 pkg:0x0
[  151.940639] DHD: dongle ram size is set to 524288(orig 524288) at 0x0
[  151.950495] dhdsdio_download_firmware: firmware path=/lib/firmware/fw_bcmdhd.bin, nvram path=/lib/firmware/bcmdhd.cal
[  152.090377] sdioh_request_buffer: [1] doing memory copy buf=f52f4000, len=2037
[  152.101261] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[  152.268848] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[  152.277494] wifi_platform_get_mac_addr
[  152.277577] wifi_get_mac_addr_intel: unable to open /config/wifi/mac.txt
[  152.293217] Firmware up: op_mode=0x0015, MAC=fc:db:b3:90:d3:00
[  152.321046] Firmware version = wl0: Aug 15 2014 15:09:17 version 6.20.190.2 (r497061) FWID 01-bb9bbd07
[  152.331344] dhd_preinit_ioctls wl ampdu_hostreorder failed -23
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/fc:db:b3:90:d3:00
Sending on   LPF/wlan0/fc:db:b3:90:d3:00
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

Wifi SSID: root@ed:~# [  180.135323] wl_bss_connect_done succeeded with c4:3d:c7:9a:ce:5d
[  180.244935] wl_bss_connect_done succeeded with c4:3d:c7:9a:ce:5d

@rsuvalle
Copy link

rsuvalle commented Jul 5, 2017

Unfortunately this method didn't work for me. It hung near the very last step for about three hours, so I quit terminal. After that I was unable to restart the process and had to login via my router and start from scratch the traditional way. Not sure what made things hang, but that's what happened.

@Lillycgm
Copy link

works amazing for me. smooth and easy.. i must be honest and i thought i wouldn´t be able to complete all the instructions even that o read them 3 or 4 times...but i just tried this new script and i´m more than please. thank u...running openaps for first time and currently customizing and setting additional wifi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment