readme.txt

! English version see below

Комплект файлов (кодировка utf-8)

Размещаются на Raspberry:

  • qmc5883l.py
  • mpu9250.py - библиотеки длоя работы с датчиками. Они немного модифицированы, чтобы данные магнитометров имели размерность миллитесла [мТ].
  • serverLib.py - библиотека с самописными классами
  • serverT.py - код сервера, считывающего датчики и отвечающего на запросы

  • serverR.py - код программного имитатора стенда. Можно разместить и не на Raspberry, а на любой машине с Python.

Размещаются на компьютере студента:

  • clientLib.py - библиотека
  • Control.py - файл, который студенты дорабатывают и запускают. Это основа для их работы.

Порядок настройки

  1. Соберите свой вариант стенда. Конечно же, у вас будут свои датчики, матриалы и компоненты. Чтобы подключить датчики, нужно либо найти соответствующую библиотеку, либо написать её самому. Правки для адаптации к новому оборудованию нужно вносить только в serverR.py; там вы найдёте прямые вызовы драйверов железа. Так как код маленький, я счёл допустимым всё так захардкодить..

  2. Проверьте доступ к Raspberry пингом. Если стенд за NATом, настройте проброс портов. Ответы с данными стенд будет посылать на адрес отправителя, на порт 6502 (можно указать свой в serverT.py, он же должен быть открыт в Control.py).

  3. Установите на Raspberry Pyhon и небходимые библиотеки: sudo apt-get install python3 pip3 install smbus2 numpy logging pigpio scipy random

pigpio должен стартовать автоматически: sudo systemctl enable pigpiod

  1. Запускайте как обычно: python3 serverR.py из каталога со скриптами

При желании можно настроить автостарт serverR.

  1. Если что-то не получается, можно посоветоваться через email: a.t.lelekov@yandex.ru

Буду рад вопросам и сотрудничеству. Удачного дня!

English version

Files:

Hosted on Raspberry:

  • qmc5883l.py , and
  • mpu9250.py - libraries for working with sensors. They are slightly modified so that the magnetometer data is in millitesla [mT].
  • serverLib.py - library with self-written classes
  • serverT.py - server code that reads sensors and responds to requests

  • serverR.py - the code of the program simulator of the testbed. It can be placed not on Raspberry, but on any machine with Python.

On the student’s computer:

  • clientLib.py - library
  • Control.py - a file that students must modify and run. This is the basis for their work.

Setup

  1. Assemble your testbed. Of course, you will have your own sensors, materials and components. To connect sensors, you need to either find the appropriate library, or write it yourself. Edits to adapt to new hardware need only be made in serverR.py; there you will find direct calls to hardware drivers. Since the code is small, I found it acceptable to hardcode everything like that..

  2. Ping your Raspberry to ensure for access. If the testbed is behind NAT, set up port forwarding. The stand will send responses with data to the sender’s address, on port 6502 (you can specify your own in serverT.py, it must also be opened in Control.py).

  3. Install Python and the required libraries, on Raspberry: sudo apt-get install python3 pip3 install smbus2 numpy logging pigpio scipy random

pigpio should start automatically: sudo systemctl enable pigpiod

  1. Run as usual, from script directory: python3 serverR.py

If desired, you can configure autostart of serverR.py

  1. If something does not work out, you can consult via email: a.t.lelekov@yandex.ru

I will be glad to questions and cooperation. Have a nice day!

Описание

Remote Laboratory on Attitude Control Systems, for Reshetnev University

Конвейеры
0 успешных
0 с ошибкой