Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to securely modify OrangePiH5orangepi.dts

Featured Replies

Hello Community!

 

File /boot/orangepi/OrangePiH5orangepi.dts is not self-explanatory.. :-(

 

Is there any documentation on how to define GPIO.21 for example for DIGITAL OUTPUT with initial "Logical ONE" at a BOOT time?

It will control Triac with 220 Volts on it. IT MUST BE EXACTLY AT HIGH LEVEL AT A BOOT TIME. How to do this? It should be in OUT mode.

 

Any help appreciated!...

 

Regards,

Ellad

 

 

48 minutes ago, eyatsko said:

/boot/orangepi/OrangePiH5orangepi.dts

First, this file doesn't exist in Armbian, so you are using probably default BSP from Xunlong...

50 minutes ago, eyatsko said:

It will control Triac with 220 Volts on it. IT MUST BE EXACTLY AT HIGH LEVEL AT A BOOT TIME.

Even if you would tweak DT to get GPIO as output, there will be quite long delay before it becomes initialized by kernel, since during all u-boot execution, it will stay floating.

So, you are better designing your hardware according to this fact. Your main triac is on 220V side, you should use an opto-triac to control it's gate, then opto-triac diode anode to +3V while cathode is on GPIO.

This way, if GPIO is floating, triac will stay Off, only when GPIO will become output LOW that it will start be conductive.

  • Author

MOC3063 used... :-) Diagram is from its typical apllication. It works very good. Nothing terrible will happen if there is a delay. Just Triac will be switched twice.  I'd like to avoid this. If it is impossible, well...

 

But how to tweak DT? I certainly need this. To define GPIO as OUT and to set it to "LOGICAL ONE".

 

Kind regards and thanx a lot for rapid response,

Ellad

8 minutes ago, eyatsko said:

Nothing terrible will happen if there is a delay. Just Triac will be switched twice. 

Why twice ?

9 minutes ago, eyatsko said:

But how to tweak DT? I certainly need this.

https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio.txt

 

But you can simply control GPIOs from userspace using sysfs, for example here is flashing script on GPIO72 :

#!/bin/bash

echo 72 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio72/direction

while true; do
	echo 0 > /sys/class/gpio/gpio72/value
	sleep 0.25
	echo 1 > /sys/class/gpio/gpio72/value
	sleep 0.25
done

 

  • Author

I'm afraid I have no such opportunity:

echo 29 > /sys/class/gpio_sw/ <Tab> <Tab> <Tab>

No such catalog: "/sys/class/gpio/export"

 

 

May you give me a simple example "to insert"..

For example, how to define Pin29 "PA7" a.k.a. "GPIO.21" to make it be "Mode=OUT, V=1"

 

"Twice" - it's because all pins according to "gpio readall" have "0". So Triac will be switched on. Then when OS will be loaded up to my script execution my BASH-script will re-define pins as OUTPUTs and set them to "1". Triac will be switched off..

I'm searching a way to define then INITIALLY to "1" as OUTPUTs. It is not so good for my shelf with Cisco 3560 Switches.. :-) (my home bench for CCNP studying).

 

OrangePiH5orangepi.dts

  • Author

This one:

root@pdu-orange:/boot/orangepi# cat /etc/issue
Ubuntu 16.04.1 LTS \n \l

root@pdu-orange:/boot/orangepi# uname -a
Linux pdu-orange.eyatsko.msk 3.10.65 #55 SMP PREEMPT Fri Nov 18 16:17:28 CST 2016 aarch64 aarch64 aarch64 GNU/Linux
root@pdu-orange:/boot/orangepi#

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.