element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Strange problem: GPIO PWM only working when connected to WiFi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 664 subscribers
  • Views 771 views
  • Users 0 members are here
  • wifi
  • gpio
  • wiringpi
  • pwm
  • raspberry_pi_space
  • raspberry pi 3
Related

Strange problem: GPIO PWM only working when connected to WiFi

baweg
baweg over 7 years ago

Hello,

 

I've got a strange problem.

I wrote a python script to send an PWM signal to GPIO1 of my Raspberry Pi 3 using the wiringpi library.

While writing the script, the Pi was connected to WiFi so that I could do it all via ssh from my notebook.

I connected a LED and it was changing the brightness as expected.

I put the python script to autostart, disconnected from WiFi and rebooted.

After that the LED did not flash anymore.

I connected to my WiFi again, started the script again an the LED was flashing.

I tried it many times and it never works without connecting to a WiFi before starting the script.

When it worked, I can disconnect from WiFi and it keeps working without WiFi until I reboot the Pi.

Does anyone here have an idea what really is the problem here?

What does a WiFi connection have to do with the GPIO pins?

 

Thanks

Bastian

  • Sign in to reply
  • Cancel
  • genebren
    genebren over 7 years ago

    Bastian,

    I am no expert on Raspberry PI stuff, but it feels like the PI is not completing the boot-up process (without the WiFi attached) to the point where your python script is invoked.

    Good luck on finding a solution.

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • baweg
    baweg over 7 years ago in reply to genebren

    I can see from the terminal messages, that my python script starts.

    It also does not print out any errors.

    It executes all GPIO commands, but it has no effect on that pins.

    Then I kill this process via ssh, start my WiFI hotspot, I see that the Raspberry Pi connects to it, start my python script again and it works.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • genebren
    genebren over 7 years ago in reply to baweg

    Batian,

     

    Generally speaking, GPIO pins have several registers that control their function.  It is possible that the WIFI code is setting some of these registers, like setting the GPIO pins as outputs.  When the WIFI is absent, the GPIO pins might not be getting set correctly.

     

    This site has a pretty good discussion of controlling the GPIO:

    https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio

     

    Good luck,

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube