Giter Site home page Giter Site logo

qthread's Introduction

Qthread = Qt + OpenThread

Architecture

Docker Environment (qthread): https://hub.docker.com/r/ryanjh31011/qthread/

  1. [Ubuntu 16.04] docker run -v ~/Desktop/qthread/ryan:/home/ryan -d -P ryanjh31011/qthread:Ubuntu16.04_latest /usr/sbin/sshd -D
  2. [Raspberry Pi2] docker run -v ~/Desktop/qthread/ryan:/home/ryan -d -P ryanjh31011/qthread:RaspberryPi2_latest /usr/sbin/sshd -D
  3. ssh -p 32779 [email protected] #The Port and IP address should be set accordantly
  4. adduser ryan #Add your user account
  5. adduser ryan sudo
  6. su - ryan #Switch to your account
  7. git clone https://github.com/ryanjh/qthread.git
  8. cd qthread/

Qt5 Run-time Environment (Raspberry Pi2):

  1. download lib/qt5pi_rpi2.tar.gz cross-compiled share libraries to target board
  2. tar zxvf lib/qt5pi_rpi2.tar.gz
  3. export LD_LIBRARY_PATH=qt5pi/lib/

Build (GitHub libqthread.a) https://github.com/ryanjh/qthread/tree/qthread_library/src

  1. [Ubuntu 16.04] Build debugging library (build/qthread/libqthread.a)

    /opt/Qt/5.8/gcc_64/bin/qmake -o build/qthread/Makefile qthread.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug

  2. [Raspberry Pi2] Build debugging library (build/qthread/libqthread.a)

    /opt/qtrpi/bin/qmake-qtrpi -o build/qthread/Makefile qthread.pro -spec devices/linux-rasp-pi2-g++ CONFIG+=debug CONFIG+=qml_debug

  3. make -C build/qthread/

Build (GitHub qt_console): https://github.com/ryanjh/qthread/tree/master/qt_console

  1. [Ubuntu 16.04] Link to debugging library (build/qthread/libqthread.a)

    /opt/Qt/5.8/gcc_64/bin/qmake -o build/qt_console/Makefile example/qt_console/qt_console.pro -spec linux-g++ CONFIG+=debug_lib CONFIG+=debug CONFIG+=qml_debug

  2. [Raspberry Pi2] Link to debugging library (build/qthread/libqthread.a)

    /opt/qtrpi/bin/qmake-qtrpi -o build/qt_console/Makefile example/qt_console/qt_console.pro -spec devices/linux-rasp-pi2-g++ CONFIG+=debug_lib CONFIG+=debug CONFIG+=qml_debug

  3. make -C build/qt_console/

Release qthread library:


Test Steps [Ubuntu16.04]:

  1. Create two devices, one becomes leader and the other one becomes child->router

(Docker Container 1) ./build/qt_console/qt_console 2

  1. Create threes devices connecting to the leader of container 1, All child->router

(Docker Container 2) ./build/qt_console/qt_console 3 5

Test Steps [Raspberry Pi2]:

  1. Create leader devices

(Ubuntu Laptop) ./qt_console

  1. Create a child device connected to the leader

(Raspberry Pi2) ./qt_console 1 2


(Appendix) Install qthread library [deprecated]

  1. sudo make -C build/qthread/ install #Install /usr/local/lib/qthread/libqthread.a

(Appendix) Link to installed library (/usr/local/lib/qthread/libqthread.a) [deprecated]

  1. /opt/Qt/5.8/gcc_64/bin/qmake -o build/qt_console/Makefile example/qt_console/qt_console.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
  2. make -C build/qt_console/

qthread's People

Contributors

ryanjh avatar

Stargazers

 avatar  avatar

Watchers

 avatar

qthread's Issues

Enable syslog of Openthread stack

/usr/local/src/openthread/src/core/api/instance_api.cpp
otLogInfoApi(sInstance, "otInstance Initialized");

/usr/local/src/openthread/src/core/common/logging.hpp
#if OPENTHREAD_CONFIG_LOG_API == 1
efine otLogInfoApi(aInstance, aFormat, ...) otLogInfo(aInstance, OT_LOG_REGION_API, aFormat, ## VA_ARGS)

/usr/local/src/openthread/examples/platforms/posix/logging.c
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.