Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266 dynamic enable & factory reset features #4686

Closed
wants to merge 6 commits into from

Conversation

LorenzMeier
Copy link
Member

@kd0aij This is your PR rebased on master.

@LorenzMeier
Copy link
Member Author

@pkocmoud The main concern with the current default is that this will disable wifi as people arm by default. I think we will need to change the default to always on and educate users (because folks flying with a tablet will else have a drone with no control, which seems dangerous).

@LorenzMeier LorenzMeier self-assigned this May 29, 2016
@LorenzMeier LorenzMeier changed the title Kd0aij wif t xmode 8266 dynamic enable & factory reset features May 29, 2016
@LorenzMeier
Copy link
Member Author

@dogmaphobic I have added GPIO0 toggling - does this look right to you / workable? Can you test?

@kd0aij
Copy link
Contributor

kd0aij commented May 29, 2016

@LorenzMeier Thanks for rebasing this. I hadn't considered the ramifications of wifi-only control. Perhaps the only way to ensure safety would be to disallow arming under specific conditions. In any case, since wifi has very limited range, the system must be safe by design even with an unreliable primary control link. We should implement a means of testing failsafe actions while a reliable RC link is still available.

@dogmaphobic
Copy link
Contributor

I have added GPIO0 toggling - does this look right to you / workable? Can you test?

Sure! Once this gets merged I'll take a look. I need to add a button within QGC to activate it.

What about the WIFI_TX_MODE param? Will it make to the main UI or stay only within the Parameters Dialog?

because folks flying with a tablet will else have a drone with no control, which seems dangerous

From the QGC side, we know if Tablet joystick mode is enabled. QGC could make sure WIFI_TX_MODE is always == 2 in those cases, though it would be safer if the flight controller would handle this.

@dogmaphobic
Copy link
Contributor

Hmm, looking at the code (ESP8266 Firmware), the pin is active low. It has a pullup resistor setup. The code below looks like active high:

#ifdef WIFI_FACTORY_DEFAULTS
    WIFI_FACTORY_DEFAULTS(1);
    usleep(500);
    WIFI_FACTORY_DEFAULTS(0);
 #endif

I can invert the logic within the ESP8266 firmware but that will require existing users to update their firmware.

@dogmaphobic
Copy link
Contributor

dogmaphobic commented May 29, 2016

Also, this looks suspicious:

#define WIFI_FACTORY_DEFAULTS(_s) px4_arch_gpiowrite(GPIO_8266_GPIO0, _s)

The proper pin is GPIO2 not GPIO0

@dogmaphobic
Copy link
Contributor

screen shot 2016-05-29 at 11 29 00 am

@kd0aij
Copy link
Contributor

kd0aij commented May 29, 2016

Which schematic is that? Looks like it may be for an early beta hardware version.
Never mind, I was looking at PD and RST, not GPIO2.

@dogmaphobic
Copy link
Contributor

Which schematic is that? Looks like it may be for an early beta hardware version.

From the bottom of this page. If that's the case, the page needs to be updated.

https://pixhawk.org/modules/pixracer

Regardless, the Reset To Factory pin is GPIO2, not GPIO0.

@kd0aij
Copy link
Contributor

kd0aij commented May 29, 2016

I was just confused, since I was looking at the serial IO page of the schematic, and missing your point about it being active low.

But isn't that pulldown on PB2, not PB4/8266_GPIO2

@dogmaphobic
Copy link
Contributor

The "Active Low" part is on the ESP8266 side. The (ESP8266 Firmware) code currently sets up a pullup on GPIO2 and the reset is handled by an interrupt when the pin is brought to LOW.

@kd0aij
Copy link
Contributor

kd0aij commented May 29, 2016

I should go back to bed :)

@LorenzMeier
Copy link
Member Author

@kd0aij Would you have bandwidth to rebase and fix / finish this?

@kd0aij
Copy link
Contributor

kd0aij commented Jun 22, 2016

I'll try rebasing and addressing Gus's comments on your reset addition.

@kd0aij
Copy link
Contributor

kd0aij commented Jun 22, 2016

@dogmaphobic I rebased and made the changes to GPIO2 that you called out. If the CI checks pass, would you test please?

@LorenzMeier
Copy link
Member Author

@dogmaphobic @kd0aij Can you pick up the testing of this so we can get this into 1.4?

@LorenzMeier
Copy link
Member Author

@dogmaphobic Would it be possible to rebase this on master and test it on hardware?

@kd0aij
Copy link
Contributor

kd0aij commented Feb 23, 2017

stale

@LorenzMeier LorenzMeier deleted the kd0aij-wifTXmode branch March 13, 2017 14:49
@devbharat
Copy link
Contributor

Is there a replacement PR for turning WiFi off when Armed? Or is this still open?

@mhkabir
Copy link
Member

mhkabir commented May 24, 2017

@devbharat There isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants