please choosego to mobile | Continue to access the PC version
View: 13171|Reply: 4

[ORANGE PI 2G IOT] Coding Python through SSH Terminal

[Copy link]

3

threads

19

posts

87

credits

Registered member

Rank: 2

credits
87
Published in 2017-9-15 10:16:16 | Show all floors |Read mode
Edited by LucasBSC at 2017-9-15 10:20

Hi everybody,

I am getting started with OPi 2G-Iot and just got to install the "python-periphery library" through Wi-Fi connection successfully established but I do not know exactly how to work with the library and the board. I saw on another post code examples but it is not clear for me how I get there or how I get started at all programming Python on OPi 2g IoT. Note: I am using the Ubuntu distro through PuTTy SSH Terminal
I am creating this thread for those who have the same issue as I do and for the ones who have the knownledge to maybe share a step-by-step to get this done smoothly.

Many thanks!

Lucas

0

threads

3

posts

14

credits

Novice

Rank: 1

credits
14
Published in 2018-1-3 15:02:39 | Show all floors
import pxssh
s = pxssh.pxssh()
if not s.login ('localhost', 'myusername', 'mypassword'):
    print "SSH session failed on login."
    print str(s)
else:
    print "SSH session login successful"
    s.sendline ('uptime')
    s.prompt()         # match the prompt
    print s.before     # print everything before the prompt.
    s.logout()
   
#We can also execute multiple command like this:
s.sendline ('uptime;df -h')
Get to touch with Python Training in Noida

0

threads

6

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2018-8-3 14:23:25 | Show all floors
I am also having problem in using python-Periphery. I am not able to execute the python code on 2G-iot.

0

threads

2

posts

8

credits

Novice

Rank: 1

credits
8
Published in 2018-8-6 13:23:57 | Show all floors
How to compile .c code on orangepi 2G-iot?

2

threads

20

posts

118

credits

Registered member

Rank: 2

credits
118
Published in 2023-8-13 00:39:07 | Show all floors
However, concerns about the company's impact on smaller businesses and its control over the market raise ethical considerations. Competitive prices and fast shipping with Amazon Prime make it a go-to choice for many readers, but alternatives are worth exploring. https://buylocalbooks.com/great-falls/
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list