Click here to Skip to main content
15,886,095 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralI told you... Pin
Kornfeld Eliyahu Peter6-Feb-21 22:55
professionalKornfeld Eliyahu Peter6-Feb-21 22:55 
GeneralRe: I told you... Pin
charlieg7-Feb-21 3:01
charlieg7-Feb-21 3:01 
GeneralRe: I told you... Pin
Kornfeld Eliyahu Peter7-Feb-21 3:16
professionalKornfeld Eliyahu Peter7-Feb-21 3:16 
GeneralRe: I told you... Pin
DRHuff7-Feb-21 4:26
DRHuff7-Feb-21 4:26 
GeneralRe: I told you... Pin
Kornfeld Eliyahu Peter7-Feb-21 5:47
professionalKornfeld Eliyahu Peter7-Feb-21 5:47 
GeneralRe: I told you... Pin
OriginalGriff7-Feb-21 5:40
mveOriginalGriff7-Feb-21 5:40 
GeneralRe: I told you... Pin
Jörgen Andersson7-Feb-21 7:43
professionalJörgen Andersson7-Feb-21 7:43 
GeneralI just leveled up! Pin
honey the codewitch6-Feb-21 19:23
mvahoney the codewitch6-Feb-21 19:23 
I've made an incredibly cool configuration system for my little smart connected gadget i'm building for a client.

When you turn it on for the first time you use it (and subsequent times until it finds what it's looking for), it scans bluetooth and wifi for potential access to a configuration gateway of sorts which can either be a WPS signal leading to internet access where it can fetch time+timezone and a friendly machine name from a couple of webservices, or it can see any nearby running apps on a bluetooth capable device before eventually giving up. When it finds one, the connected app on PC or phone pops a wizard (like google's sign in screens) that allow you to set the name, and optionally give it the wifi password. If you don't give it the wifi password it won't bother turning on the wifi radio anymore because it just wastes battery. At any rate, this configuration information is saved. It can be reset to factory by holding the "connect" button for 5 seconds on boot. The "connect" button works like a bluetooth pairing button except it advertises over WiFi too by publishing itself as a UPnP (universal plug and play) device.

The app(s) can connect with it through either mechanism. This way it works with computers that don't have bluetooth like many desktop PCs and some laptops and tablets.

It turns off the radios when they aren't in use to save battery. The connect button is basically how you turn them on again, but once connected it will stay connected for as long as it needs to. eventually, the app will stop sending keep alives and it will time out.

This was difficult code to write. There are a lot of cases and a lot of little hardware issues to manage, like controlling the radios and their power levels, and converting a 32bit ARGB color code into the necessary voltages for the RGB status LED so you can tell what the radios and the configuration system are doing - blue for bluetooth, yellow for wifi, pink for configuring, red while resetting to factory. Sometimes they cycle between colors to indicate multiple activities such as searching over bluetooth and wifi while fetching config info causing it to cycle blue,yellow, and pink.

Also the entire thing is cooperatively multithreaded so you can keep using the device while it's doing all of this.

Anyway, I'm pretty proud of it. It's my first bluetooth project and my second UPNP project. Not too shabby, IMO.

*pats self on back* Shucks | :-\
Real programmers use butterflies


modified 7-Feb-21 1:29am.

GeneralRe: I just leveled up! Pin
Roger Wright6-Feb-21 20:32
professionalRoger Wright6-Feb-21 20:32 
GeneralRe: I just leveled up! Pin
Nelek7-Feb-21 0:24
protectorNelek7-Feb-21 0:24 
GeneralRe: I just leveled up! Pin
honey the codewitch7-Feb-21 1:41
mvahoney the codewitch7-Feb-21 1:41 
GeneralRe: I just leveled up! Pin
Nelek7-Feb-21 5:56
protectorNelek7-Feb-21 5:56 
GeneralRe: I just leveled up! Pin
Roger Wright8-Feb-21 13:02
professionalRoger Wright8-Feb-21 13:02 
GeneralRe: I just leveled up! Pin
honey the codewitch7-Feb-21 1:38
mvahoney the codewitch7-Feb-21 1:38 
GeneralRe: I just leveled up! Pin
Mike Hankey7-Feb-21 3:55
mveMike Hankey7-Feb-21 3:55 
GeneralRe: I just leveled up! Pin
Roger Wright8-Feb-21 13:07
professionalRoger Wright8-Feb-21 13:07 
GeneralRe: I just leveled up! Pin
Mike Hankey8-Feb-21 13:19
mveMike Hankey8-Feb-21 13:19 
GeneralRe: I just leveled up! Pin
Daniel Pfeffer6-Feb-21 21:00
professionalDaniel Pfeffer6-Feb-21 21:00 
GeneralRe: I just leveled up! Pin
honey the codewitch7-Feb-21 1:38
mvahoney the codewitch7-Feb-21 1:38 
GeneralSaw this today.. Pin
DRHuff6-Feb-21 14:13
DRHuff6-Feb-21 14:13 
GeneralRe: Saw this today.. Pin
Peter_in_27806-Feb-21 17:41
professionalPeter_in_27806-Feb-21 17:41 
GeneralRe: Saw this today.. Pin
Richard MacCutchan6-Feb-21 22:20
mveRichard MacCutchan6-Feb-21 22:20 
GeneralRe: Saw this today.. Pin
DRHuff7-Feb-21 3:03
DRHuff7-Feb-21 3:03 
GeneralRe: Saw this today.. Pin
jsc427-Feb-21 3:56
professionaljsc427-Feb-21 3:56 
GeneralRe: Saw this today.. Pin
DRHuff7-Feb-21 4:27
DRHuff7-Feb-21 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.