Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 2949|Reply: 3

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

[Copy link]

3

Threads

19

Posts

87

Credits

Registered member

Rank: 2

Credits
87
Post time 2017-9-15 10:16:16 | Show all posts |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
Post time 2018-1-3 15:02:39 | Show all posts
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
Post time 2018-8-3 14:23:25 | Show all posts
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
Post time 2018-8-6 13:23:57 | Show all posts
How to compile .c code on orangepi 2G-iot?
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-8-25 08:58 GMT+8 , Processed in 0.026379 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list