Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 29,555
» Latest member: powerscrews
» Forum threads: 16,210
» Forum posts: 116,965

Full Statistics

Latest Threads
Why projects like PinePho...
Forum: General Discussion on PinePhone
Last Post: Gary2003
3 hours ago
» Replies: 11
» Views: 7,552
Cannot flash the modem fi...
Forum: Mobian on PinePhone
Last Post: anonymous
9 hours ago
» Replies: 2
» Views: 1,074
Mobian MMS/SMS text probl...
Forum: Mobian on PinePhone
Last Post: georgegohl888
Yesterday, 02:42 AM
» Replies: 16
» Views: 19,979
Default password for KDE ...
Forum: General Discussion on PinePhone
Last Post: Toni
09-14-2025, 06:35 PM
» Replies: 0
» Views: 799
My Phone stopped making a...
Forum: PinePhone Hardware
Last Post: tracyanne
09-14-2025, 03:30 PM
» Replies: 0
» Views: 955
StarPro64 Irradium (based...
Forum: Getting Started
Last Post: mara
09-14-2025, 01:56 PM
» Replies: 9
» Views: 3,547
Can use PlayStation on Pi...
Forum: General Discussion on PinePhone
Last Post: ChaiLetters
09-13-2025, 12:30 AM
» Replies: 7
» Views: 8,151
Brand new sealed Pinetime...
Forum: General Discussion on PineTime
Last Post: elver
09-10-2025, 06:41 AM
» Replies: 0
» Views: 3,228
Call recording?
Forum: PinePhone Pro Software
Last Post: biketool
09-09-2025, 04:14 AM
» Replies: 7
» Views: 9,886
Thoughts after a year wit...
Forum: General Discussion on Pinebook Pro
Last Post: Frank23t
09-08-2025, 10:30 PM
» Replies: 4
» Views: 5,169

 
  Active Cooling soft PWM follow-on fan motor speed controller driver
Posted by: MarkHaysHarris777 - 07-25-2016, 07:21 AM - Forum: Pi2, Euler and Exp GPIO Ports - Replies (3)

(for schematic diagram and in-line wiring harness, see this link)

edit:  I changed the default soft-pwm to GPIO23, pin(16).

   

The PWM (pulse width modulation) is 'soft' because it does not use a hardware oscillator. The Python codes turn the transistor on and off ( 16ms on,  4ms off) about 50 pps. The base-emitter pulls only about 2ma from the GPIO pin, while the collector current takes the main motor drive current (about 140ma for this fan).

The following two pics are my 'double' controller one half driving the PI 3B, and the other half driving the PineA64. In each case the Python code is the same; posted below:

   

   

In the pic above I also have my ada fruit gps (746) breakout mounted on the ttyS4 uart4 on the PineA64 euler bus.

fan_motor.sh

Code:
#!/usr/bin/python
#
# fan_motor.sh
#*****************************************************************
#  author:     Mark H. Harris      
# license:     GPLv3
#
#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
#   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
#   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#   MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENCIAL DAMAGES (INCLUDING, BUT
#   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERUPTION)
#   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE
#   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#*****************************************************************
## Import the necessary header modules
from time import sleep
import signal as SIGNAL
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)

## SOFTWARE PWM GPIO23 pin(16)
soft_pwm = 23
GPIO.setup(soft_pwm, GPIO.OUT)

ms_on = .016
ms_off = .004
hup_flag = False

## FUNCTION DEFINITIONS

def motor_duty_on(m_pin, t_delay):
    GPIO.output(m_pin, True)
    sleep(t_delay)
    
def motor_duty_off(m_pin, t_delay):
    GPIO.output(m_pin, False)
    sleep(t_delay)

def end():
    GPIO.cleanup()
    quit()

def ssighup(signum, frame):
    global hup_flag
    global ms_on
    global ms_off
    if (hup_flag):
        ms_on = .016
        hup_flag=False
    else:
        ms_on = .250
        hup_flag=True
    print(" ")
    print("HUP: duty_cycle toggled value: "+str(ms_on))

SIGNAL.signal(SIGNAL.SIGHUP, ssighup)

kb_interrupt = False

while(not kb_interrupt):
    try:
        motor_duty_on(soft_pwm, ms_on)
        motor_duty_off(soft_pwm, ms_off)
    except KeyboardInterrupt:
        kb_interrupt = True
        print(" ")
        print("motor controller ended by interrupt, bye!")

end()


marcus

edit:  I changed the default soft-pwm to GPIO23, pin(16).


  Active Cooling 5v brushless fan with Motor Speed Controller soft PWM
Posted by: MarkHaysHarris777 - 07-25-2016, 06:47 AM - Forum: Pi2, Euler and Exp GPIO Ports - Replies (14)

   

The fan above is a 5v brushless 140ma fan (free standing on rubber fan mounts) capable of moving 5cfpm ; being driven by a python software PWM motor speed control driver using a PN2222 transistor to handle the current. The GPIO pin signals the transistor via 1k ohm resistor. The codes rely on the RPi.GPIO-PineA64 module from github.

I will be uploading the python codes near the bottom of this post.

The following two pics are close-in shots of the fan, and the transistor current driver:

   

   

The PN2222 transistor above can also be replaced by the 2N2222; although, the emitter collector pins are swapped-- the emitter goes to ground.

The fans ship from Jin LI , and as such take three to six weeks to ship to the U.S. Its the shipping, not Jin LI's fault. These little fans move a lot of air; however, they are also noisy. The speed control circuit quiets the fans considerably to a slight whisper, still moves the air more efficiently, and may be controlled off, or controlled by signal based on SoC temperature.

fan_motor.sh

Code:
#!/usr/bin/python
#
# fan_motor.sh
#*****************************************************************
#  author:     Mark H. Harris        
# license:     GPLv3
#
#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
#   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
#   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#   MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENCIAL DAMAGES (INCLUDING, BUT
#   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERUPTION)
#   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE
#   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#*****************************************************************
## Import the necessary header modules
from time import sleep
import signal as SIGNAL
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)

## SOFTWARE PWM GPIO23 pin(16)
soft_pwm = 23
GPIO.setup(soft_pwm, GPIO.OUT)

ms_on = .016
ms_off = .004
hup_flag = False

## FUNCTION DEFINITIONS

def motor_duty_on(m_pin, t_delay):
    GPIO.output(m_pin, True)
    sleep(t_delay)
    
def motor_duty_off(m_pin, t_delay):
    GPIO.output(m_pin, False)
    sleep(t_delay)

def end():
    GPIO.cleanup()
    quit()

def ssighup(signum, frame):
    global hup_flag
    global ms_on
    global ms_off
    if (hup_flag):
        ms_on = .016
        hup_flag=False
    else:
        ms_on = .250
        hup_flag=True
    print(" ")
    print("HUP: duty_cycle toggled value: "+str(ms_on))

SIGNAL.signal(SIGNAL.SIGHUP, ssighup)

kb_interrupt = False

while(not kb_interrupt):
    try:
        motor_duty_on(soft_pwm, ms_on)
        motor_duty_off(soft_pwm, ms_off)
    except KeyboardInterrupt:
        kb_interrupt = True
        print(" ")
        print("motor controller ended by interrupt, bye!")

end()

The code may be signaled with a -SIGHUP which when received by the speed controller code will toggle the duty cycle of the soft PWM. from 80% to 100%. A second HUP will toggle the duty cycle back to 80%, or slow speed.

There will be a follow-on post with some more pics, as well a simple schematic.

edit: I changed the default soft-pwm pin to GPIO23, pin(16).


marcushh777


  GbE: Optionally force master mode for RTL PHY
Posted by: xalius - 07-25-2016, 06:04 AM - Forum: Linux on Pine A64(+) - Replies (1)

A while back I stumbled over this patch for u-boot https://patchwork.ozlabs.org/patch/602067/ forcing the RTL80211C/E PHY into master mode to overcome some issues when the PHY is in slave mode.

Maybe this could be a source for the random GbE problems we see here sometimes?

I was just looking at Olimex blog and read the specs for their A64 board, and one of the features reads:


Code:
...
* Ethernet Gigabit interface works just in master mode
...

I tried adding the register read-modify-write to the 3.10.x BSP driver but failed, maybe someone with better skills can have a look at it? The patch boils down to:


Code:
/* RTL8211x 1000BASE-T Control Register */
#define MIIM_RTL8211x_CTRL1000T_MSCE (1 << 12);
#define MIIM_RTL8211X_CTRL1000T_MASTER (1 << 11);

...

    unsigned int reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_CTRL1000);
    /* force manual master/slave configuration */
    reg |= MIIM_RTL8211x_CTRL1000T_MSCE;
    /* force master mode */
    reg |= MIIM_RTL8211X_CTRL1000T_MASTER;
    phy_write(phydev, MDIO_DEVAD_NONE, MII_CTRL1000, reg);

...


One read-modify-write operation....


Star Pine64 1GB Auto POwer Off
Posted by: Mohit B - 07-25-2016, 03:08 AM - Forum: Getting Started - Replies (1)

Hi,

I have downloaded the Phoenix Card image of the rooted android on 8 GB card. First boot was OK. I configured my WiFi, tested Bluetooth. I installed YouTube.

As soon as I fired up the YouTube app my screen went black. I rebooted by powering off and then on. While booting it said optimizing android.

Now every-time after 10 seconds of boot the board powers off automatically.

What should I do.

Regards,
MB


  The Debian Jessie User Accounts?
Posted by: jesse1234 - 07-25-2016, 01:30 AM - Forum: Getting Started - Replies (6)

I am using the Debian Jessie OS but I cannot locate the User Accounts Application. I want to change my personal information like Name and Password, etc.

Jesse


  When & How to use resize_rootfs.sh?
Posted by: jesse1234 - 07-25-2016, 01:25 AM - Forum: Getting Started - Replies (5)

Quote:
  • Execute resize_rootfs.sh script to resize the root partition in order to fully utilize the SD Card

Well I have the Debian Jessie OS up and running but I am using a 32GB SD card that only sees according to the Disk Usage Analyzer only 7.5 GB.

I tried using the terminal to execute the script but I am not sure where in the file system it is located!?

When & How to use resize_rootfs.sh?

Jesse  Huh


  miss a lot of parts of my backer order
Posted by: visigalmarco - 07-24-2016, 11:36 PM - Forum: Shipment Related Discussion - Replies (3)

Good morning, this afternoon I receved a very little part of my items in particular: 

2- 4 Way 12C Cable;
2- 5 Way to 4-Way I2C Cable;
2- 5 Way 12C Cable;
2- PA642GB;
1- PMSD001;
1- PINE64 Basic Media IR Remote Control;              
1- POWER SUPPLY;
1- P64-ALUMENIUM ENCLOSURE.

they are missing:
1- 64GB MicroSD Android
1- 7" LCD Touch Screen
1- 802.11BGN Wifi/ BT4.0 Module
1- PlayBox Kit
1- HDMI to DVI Adapter
1- HDMI to VGA Adapter With Audio
2- 4K HDMI Cable - 3FT
2- 7" LCD Touch Screen Panel
1- Wifi 802.11BGN/ Bluetooth 4.0 Module
2- PINE64 PlayBox Enclosure
2- PINE64 Acrylic Open Enclosure
2- PoE Splitter comply to 802.3af standard
1- PINE64 Z-Wave Module (EU version)
1- PINE A64+ 2GB - PA642GBWIFI
1- 64GB MicroSD Card - 64GBLIN
1- PINE64 Basic Media IR Remote Control
2- 5MP Camera Module

Can you say me when send the rest of my items?

My Backer number is 21,219

best regards
Marco Visigalli


  ssh into Pine64 running Android
Posted by: scarabus - 07-24-2016, 08:58 PM - Forum: Android on Pine A64(+) - Replies (5)

I can easily ssh into my Pine64 running Ubuntu, but I'm going around in circles trying to figure out how to do it under Android. 
Is there a HOWTO anywhere?


  Passthrough Audio Netflix and Plex Android
Posted by: User 4127 - 07-24-2016, 07:30 PM - Forum: Android on Pine A64(+) - Replies (10)

I've got my PINE64 connected via HDMI to my receiver but its not passing through Dolby or DTS in either Plex or Netflix. Is this a possibility or was my hope misplaced?


  Upgrade Path Rooted Android
Posted by: User 4127 - 07-24-2016, 07:28 PM - Forum: Android on Pine A64(+) - Replies (10)

Since OTA is only for non rooted, is there going to be a better way to upgrade rooted android without doing a fresh image install everytime?