====== SCD-ScriptingCommandDispatcher: Pro ====== [[http://www.openhardsoftware.de/ | Open Hard- & Software]] [ [[http://www.openhardsoftware.de/dokuwiki | DokuWiki]] [[http://www.openhardsoftware.de/websites | WebSites]] [[http://www.openhardsoftware.de/mediawiki | MediaWiki]] [[http://www.openhardsoftware.de/nextcloud | NextCloud]] ] ==== Vortragsreihe: RRC ==== * RRC-Hauptfolie * Folie Übersicht * Folie Kapitel1 * Folie Thema11 -> Filmsegment11 * Folie Thema12 -> Filmsegment12 * ... * Folie Thema1N1 -> Filmsegment1N1 * Folie Kapitel2 -> Filmsegment2 * Folie Thema21 * Folie Thema22 * ... * Folie Thema2N2 * ... * Folie KapitelN -> FilmsegmentN ==== Ideen ==== * Ergänzende Idee(Android, Java): * Unser RRC möchten wir später ja mit einem Host (PC, Tablet, Handy mit entsprechendem BS) steuern... * Daher brauchen wir Applications unter Windows, Android, Linux, Ios, welche diese Steuerung des RRC ausführen. * Daher mein Vorschlag: *- wir schreiben unter Android eine Demo-App und veröffentlichen diese App im PlayStore *- unter Führung des Ios-Kenners Werner unternehmen wir entsprechendes im AppleStore *- danach kommt der Windows AppStore als Ergänzung. * (alle Schritte mit Hilfsmittel Zoom über WebMeeting dokumentieren) * AS5600 Encoder für DiametralMagnete * alle Teile für Nema17 vorhanden * OOO Projekt generieren * QtDesigner auf English umstellen - bisher überhaupt nichts passendes gefunden :-( * allgemeines Konzept: mit SDCard: **AVL-AnalogVoltageLogger** * 2202031045 - Walter Gespräch über Jan Heise / Boris Dabrowski * Borys Dabrowski: * HW: ArduinoDue mit 74HC4067 * SW: ADConversion von 20 gemultiplexten AnalogVoltages * Idee zu Boris Dabrowski: * **RSR-RadioSpectrometerReporter** / **RSA-RadioSpectrometerAnalysis** * ArduinoDue mit 74HC4067 über UartUC an Esp32(uP/C++)Controller vernetzen * ADueRadioSpectrometerController (C++) * Esp32RadioSpectrometerDispatcher (erst uP, dann C++) * Scriptor (MicroPython) über UartUC vernetzen * RPiPicoRadioSpectrometerScriptor * Software PC-GUI (Python) schreiben * RadioSpectrometerCommander * Jan Heise: * MicroPython * RRC - Energy-Management * LiIo-Accus * Controller regulated Supply * Supply-Shutdown UnderVoltage-Detection * RRC - RemoteRobotCar * RCC - RobotCarController * eigene Platine RCC-RobotCarController: * Basis: Esp32UnoBoard * 2x Left-Motors (MLB, MLF) * 2x Right-Motors (MRF, MRB) * 8x Ultrasonic-Sensor (LB, LM, LF, FF, RF, RM, RB, BB) * 2x Mini-MotorDriver TB6612, L298-Ersatz (bestellt!) * 2x PositionEncoder (PEL, PER) direkt an Motoren mit Lichtschranken gekoppelt * 1x Keyboard4x4 * 1x LCDisplayI2C * später (Austausch MicroPython gegen Cplusplus): Lan mit W5500-Modul * KEINE SDCard!!! ==== 2202xx: RemoteRobotCar - CommanderPC ==== * Gui Python Qt: Eingabe von Commands an RRC-Controller(UartUC) * Gui Python Qt: Eingabe von Commands an RRC-Controller(WlanUdp) ==== 2202xx: RemoteRobotCar - CommanderAD ==== * Gui Python Qt: Eingabe von Commands an RRC-Controller(BtUart) ==== 2202xx: Mini-Projekt: Eigenes Widget für ein TabPage erstellen ==== * Erzeugung eines Custom-Controls ==== 2202xx: WICHTIG: Dispatcher.AnalyseResponse programmieren (uP)!!!! ==== ==== 2202xx: WICHTIG: Dispatcher.AnalyseResponse programmieren (C++)!!!! ==== ==== 220307: Constants in MicroPython ==== * from micropython import const ==== 220308: WebPages OHSW.de ==== * Themenhierachie * Mathematik-Grundlagen-Dreisatz: * a/b = u/(h-b) ==== 2203xx: WebPages OHSW.de ==== * RPiPico: Reset-Button bei der Programmierung unter VSCode ----- * implement: MFS_CopyFileToCFS * implement: CFS_CopyFileToMFS * **OOO** PC-Response konsequent für alle Commands * **OOO** UC-Response konsequent für alle Commands ... jetzt Umstellung auf TRR - TransmitReceiveRing-Protocol ==== 220320: PcSCDScriptorRemoter/PcRPiPico ==== * Version: {{:project:SCD_ScriptingCommandDispatcher:2203190924_PcSCDScriptorRemoter_01V30.zip | 2203190924_PcSCDScriptorRemoter_01V30.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203190924_RPiPicoSCDScriptor_01V30.zip | 2203190924_RPiPicoSCDScriptor_01V30.zip}} ==== 220319: PcSCDScriptorRemoter/PcRPiPico: Einbau CFS-Load/Save/Execute ==== * X PC-Response Problem gelöst: Result nun für Load/Save CFS registriert * X SDCard einbauen ==== 220318: PcSCDScriptorRemoter/PcRPiPico: CFS-Load/Save/Execute ==== * SDCard-Module OOP-Gestaltung * Neugestaltung CFS_OpenWrite / CFS_WriteLine / CFS_CloseWrite: * MFS/CFS: auf jeden Fall statt **os** auf jeden Fall **uos** verwenden!!! * Neuprogrammierung MFS/CFS: * Version: {{:project:SCD_ScriptingCommandDispatcher:2203181730_RPiPicoFileMfsSdc_01V05.zip | 2203181730_RPiPicoFileMfsSdc_01V05.zip}} ==== 220317: PcSCDScriptorRemoter/PcRPiPico: CFS-Load/Save/Execute ==== * Neugestaltung CFS_OpenWrite / CFS_WriteLine / CFS_CloseWrite * Problem mit SDCard-Module ==== 220317: PcSCDScriptorRemoter/PcRPiPico: MFS-Load/Save/Execute ==== * Verbesserung MFS_OpenRead / MFS_ReadLine / MFS_CloseRead * Neugestaltung MFS_OpenWrite / MFS_WriteLine / MFS_CloseWrite * Version: {{:project:SCD_ScriptingCommandDispatcher:2203171052_PcSCDScriptorRemoter_01V23.zip | 2203171052_PcSCDScriptorRemoter_01V23.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203171052_RPiPicoSCDScriptor_01V23.zip | 2203171052_RPiPicoSCDScriptor_01V23.zip}} * MFS_ExecuteFile: * Version: {{:project:SCD_ScriptingCommandDispatcher:2203171847_PcSCDScriptorRemoter_01V24_run.zip | 2203171847_PcSCDScriptorRemoter_01V24_run.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203171847_RPiPicoSCDScriptor_01V24_run.zip | 2203171847_RPiPicoSCDScriptor_01V24_run.zip}} ==== 220316: PcSCDScriptorRemoter - PcRPiPico ==== * Neugestaltung MFS_OpenRead / MFS_ReadLine / MFS_CloseRead ==== 220315: PcSCDScriptorRemoter - PcRPiPico ==== * Restart mit: * PcSCDScriptorRemoter: 2203130856_PcSCDScriptorRemoter_orderedpresavemfs.zip * PcRPiPico: 2203091434_RPiPicoSCDScriptor_01V14_pclocalscriptor.zip * Neues HS Command: @ST CMD {PI} -> Response: $ST CMD 0/1 {PI} * Funktion: WaitForCommandResponseFinished * PcSCDScriptorRemoter: * Gui-Erweiterung Local:SetLSOn/Off -> Scriptor:SetLSOn/Off * DispatcherBase-PushCommand (Push eleminieren, ersetzen mit CommandResponse): * self.CommandPushed = True -> self.CommandResponse = commandline * AnalyseCommand: keine Abfrage auf TokenCount mehr * AnalyseRxLine: für alle RxLines: Tokens = [rxline[4:7], rxline[8:]] (maximal zwei Token) * PcRPiPico: * AnalyseCommand: keine Abfrage auf TokenCount mehr ==== 220314: PcSCDScriptorRemoter - PcRPiPico ==== * MFS: Save : Muell * Sackgasse: aktuelle Version zwar mit einigermassen Save, aber Load Katastrophe -> Neuanfang Save/Load! ==== 220313: PcSCDScriptorRemoter - PcRPiPico ==== * **X** Define.Error/Warning/Debug/Message * nach PcSCDScriptorRemoter-01V20 nun auch Nach-/Auf-Bearbeitung der PcRPiPico-Version mit beidseitigen Commands(!) * MFS: Save/Load/Execute/CopyToCFS * CFS: Save/Load/Execute/CopyToMFS ==== 220312: PcSCDScriptorRemoter - PcRPiPico ==== * Script_OnLoadFilePCCommand mit Leben füllen... * Script_OnSaveFilePCCommand mit Leben füllen... * Version: {{:project:SCD_ScriptingCommandDispatcher:2203120945_PcSCDScriptorRemoter_01V19_commandload.zip | 2203120945_PcSCDScriptorRemoter_01V19_commandload.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203121612_PcSCDScriptorRemoter_01V20_lsxscript.zip | 2203121612_PcSCDScriptorRemoter_01V20_lsxscript.zip}} ==== 220311: PcSCDScriptorRemoter - PcRPiPico ==== * Commands Load/SavePC, FSM mit Thread * !!! TimeOut bei Ausbleiben des $-Response! * Commands Load/Save/Execute/Copy einbauen - mit Thread und FSM! * OOO SaveFile to PC: ebenfalls mit FSM TextBox-Text Open/LineByLine/Close (mit TimeOut) auf HD speichern! * möglichst in CPCFile kapseln! * -------------------------------- * doch zuvor: Simulation-Motor mit Commands in PcSCDScriptorRemoter: CPCMotor.py * -------------------------------- * Software-Handshake mit Commnands bei Script-Abarbeitung * Notwendigkeit: open/closeRead und readline(!) * Test bei Blinky-Script: * Handshake nach jedem Command (auch local in PC!) (WaitForCommandFifoEmpty!!!) after each SetOn/SetOff * Execute-Button auf PC-Side integrieren ==== 220310: PcSCDScriptorRemoter - PcRPiPico ==== * Version: {{:project:SCD_ScriptingCommandDispatcher:2203101823_PcSCDScriptorRemoter_01V17.zip | 2203101823_PcSCDScriptorRemoter_01V17.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203101809_PcSCDScriptorRemoter_01V16_prescriptlse.zip | 2203101809_PcSCDScriptorRemoter_01V16_prescriptlse.zip}} ==== 220309: PcSCDScriptorRemoter - PcRPiPico ==== * Version: {{:project:SCD_ScriptingCommandDispatcher:2203101510_PcSCDScriptorRemoter_01V15_simmotor.zip | 2203101510_PcSCDScriptorRemoter_01V15_simmotor.zip}} ==== 220309: PcSCDScriptorRemoter - PcRPiPico ==== * **X** TxCommand -> Command -> Fifo: Commands * **X** CommandFiFo definieren und mit FSM (SoftwareHS) kontrolliert abarbeiten lassen * **X** SingleCommand, .. MultiCommand testen * **X** (Re-)Aufbau des CommandFifos * Version: {{:project:SCD_ScriptingCommandDispatcher:2203091434_PcSCDScriptorRemoter_01V14_pclocalscriptor.zip | 2203091434_PcSCDScriptorRemoter_01V14_pclocalscriptor.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203091434_RPiPicoSCDScriptor_01V14_pclocalscriptor.zip | 2203091434_RPiPicoSCDScriptor_01V14_pclocalscriptor.zip}} ==== 220308: PcSCDScriptorRemoter - PcRPiPico ==== * Basis PC: 2203061511_PcSCDScriptorRemoter_01V03 und * Basis MC: 2203061511_RPiPicoSCDScriptor_01V03 * Gui: Buttons für CopyMFS->CFS vv * Command LedSystemOn/Off ==== 220307: RPiPico - RPiPicoFileMfsSdc ==== * Lesen und Schreiben von Files auf MFS-MemoryFileSystem und (parallel!) SDC-SDCard * Einbau der optimierten Library sdcard.py aus '2203071151_RPiPicoSDCard_01V02' in '2203061153_RPiPicoFile_01V02_filedirectory' * Version: {{:project:SCD_ScriptingCommandDispatcher:2203071519_RPiPicoFileMfsSdc_01V04.zip | 2203071519_RPiPicoFileMfsSdc_01V04.zip}} * -> jetzt übertragen MFS und SDC nach 2203061511_PcSCDScriptorRemoter_01V03 * -> jetzt übertragen MFS und SDC nach 2203061511_RPiPicoSCDScriptor_01V03 ==== 220307: RPiPico - SDCard ==== * download library 'sdcard.py': * {{ https://raw.githubusercontent.com/micropython/micropython/master/drivers/sdcard/sdcard.py | sdcard.py}} * Anleitung für Anschluss SDCard3V3-Module: * {{https://www.digikey.com/en/maker/projects/raspberry-pi-pico-rp2040-sd-card-example-with-micropython-and-cc/e472c7f578734bfd96d437e68e670050 | Anleitung}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203071106_RPiPicoSDCard_01V01.zip | 2203071106_RPiPicoSDCard_01V01.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2203071151_RPiPicoSDCard_01V02.zip | 2203071151_RPiPicoSDCard_01V02.zip}} ==== 220306: PC-RPiPico ==== * Blinkender RPiPico mit (noch lokalem!) Script 'blinky.py': * PcSCDScriptorRemoter: {{:project:SCD_ScriptingCommandDispatcher:2203061511_PcSCDScriptorRemoter_01V03.zip | 2203061511_PcSCDScriptorRemoter_01V03.zip}} * RPiPicoSCDScriptor: {{:project:SCD_ScriptingCommandDispatcher:2203061511_RPiPicoSCDScriptor_01V03.zip | 2203061511_RPiPicoSCDScriptor_01V03.zip}} * PcSCDScriptorRemoter: neben 'ExecuteScript' auch 'Load/SaveScript' * dafür werden die Ergänzungen in CFile notwendig: * SaveLine (jeweils einzelne Zeile mit eigenem Open/Close) (vorher: SaveText/Lines : ganze Text mit einem Open/Close) * LoadLine (jeweils einzelne Zeile mit eigenem Open/Close) (vorher: LoadText/Lines : ganze Text mit einem Open/Close) ==== 220306: MicroPython File-Handling ==== * OOP CFile-Handling (WriteText, ReadText, AppendText, WriteLines, ReadLines, AppendLines) * CDirectory-static Class (list, Make, Change, FileExists, RenameFile, RemoveFile) * {{:project:SCD_ScriptingCommandDispatcher:2203061153_RPiPicoFile_01V02_filedirectory.zip | 2203061153_RPiPicoFile_01V02_filedirectory.zip}} ==== 220304: MicroPython File-Handling ==== * File-Handling (WriteFile, ReadFile, AppendFile) in MicroPython (auf dem RPiPico) 👍 * {{:project:SCD_ScriptingCommandDispatcher:2203041929_RPiPicoFile_01V01_rwafile.zip | 2203041929_RPiPicoFile_01V01_rwafile.zip}} * {{:project:SCD_ScriptingCommandDispatcher:2203041933_MicroPythonFileHandling.jpg?400 | 2203041933_MicroPythonFileHandling.jpg}} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ ==== 220303: SCD - Remote Scriptor ==== * {{:project:SCD_ScriptingCommandDispatcher:2203031051_RPiPicoSCDScriptor_01V02_threadexecute.zip | 2203031051_RPiPicoSCDScriptor_01V02_threadexecute.zip}} * Single-Betrieb mit PcSCDScriptorRemoter und RPiPicoSCDScriptor, verbunden über UartCB: * {{:project:SCD_ScriptingCommandDispatcher:2203031502_RPiPicoSCDScriptor_01V11.zip | 2203031502_RPiPicoSCDScriptor_01V11.zip}} * {{:project:SCD_ScriptingCommandDispatcher:2203031502_PcSCDScriptorRemoter_01V11.zip | 2203031502_PcSCDScriptorRemoter_01V11.zip}} * SCD-ScriptingCommandDispatcher: * prinzipiell scheint die MicroPython-Script-Verarbeitung in einem Thread (hier auf einem RaspberryPiPico(!)) sauber zu funktionieren * 👍 * damit erreicht: * - PC: 2201272140_PcTerminalUartUsb_01V00 (Python) sendet XSC-Command "XSC blinky.py" (ExecuteScript blinky) über UsbUart zum RPiPico * - RPiPico: 2203031502_RPiPicoSCDScriptor_01V11 (MicroPython) empfängt über UsbUart Execute-Command und führt das (lokal gespeicherte) Script "blinky.py" aus... * {{:project:SCD_ScriptingCommandDispatcher:2203031631_SCD_Scriptor.jpg?500 | 2203031631_SCD_Scriptor.jpg}} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ ==== 220302: SCD - ==== * {{:project:SCD_ScriptingCommandDispatcher:2203020938_RPiPicoSCDScriptor_01V01_dispatcher.zip?400 | 2203020938_RPiPicoSCDScriptor_01V01_dispatcher.zip}} ==== 220224: SCD - Mischung von HW und SW ==== * nach PassThrough: Single-Connect mit AnalyseRxLine * mit Hard-und Software-Chain - geschafft!!!!! : * {{:project:SCD_ScriptingCommandDispatcher:2202281629_Esp32SCDUnoBoard_01V12_swhwchain.zip | 2202281629_Esp32SCDUnoBoard_01V12_swhwchain.zip}} * {{:project:SCD_ScriptingCommandDispatcher:2202281629_ScriptingCommandDispatcher_03V12_swhwchain.zip | 2202281629_ScriptingCommandDispatcher_03V12_swhwchain.zip}} ==== 220224: SCD - Mischung von HW und SW ==== * SCDUnoBoard: zuerst: PassThrough RxLine -> TxLine ohne Analyse * Version: {{:project:SCD_ScriptingCommandDispatcher:2202281440_ScriptingCommandDispatcher_03V10_passthrough.zip | 2202281440_ScriptingCommandDispatcher_03V10_passthrough.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2202281440_Esp32SCDUnoBoard_01V10_passthrough.zip | 2202281440_Esp32SCDUnoBoard_01V10_passthrough.zip}} ==== 220224: SCD - Mischung von HW und SW ==== * SCD in MicroPython schreiben für Esp32SCDHardware, Version 02Vxx !!! * Vorlage für Esp32-MicroPython: PC-Version ScriptingDeviceDispatcher * Vorlage für Esp32-MicroPython: 2202180922_Esp32SCDHardware_01V02_commandchain.zip * Vorlage für Esp32-MicroPython: 2201232053_Esp32ScriptingCommandDispatcher_01V11_base.zip * erster Esp32SCDHardware-Test: Durchreichen von TxLines und RxLines ohne Interpretation ==== 220224: SCD - Test (erfolgreich!) ==== * Probe: Debug-Ausgabe: * OnBusy: TxCommand: print('++++++++') * WaitingResponse = command * AnalyseResponse: print('-------') * WaitingResponse = '' * alle Devices funktionieren sauber mit Fifo-Abarbeitung! * Version {{:project:SCD_ScriptingCommandDispatcher:2202240746_ScriptingCommandDispatcher_03V08_stack.zip | 2202240746_ScriptingCommandDispatcher_03V08_stack.zip }} ==== 220223: SCD - ==== * erst einmal geschafft: * {{:project:SCD_ScriptingCommandDispatcher:2202231153_ScriptingCommandDispatcher_03V06_stack.zip | 2202231153_ScriptingCommandDispatcher_03V06_stack.zip}} * speziell: <@XH LSO> : 10x LSO/LSF -> TxCommands, Abarbeitung ==== 220222: SCD - ==== * Idee: neue Struktur: * neben RxLines und TxLines noch TxCommands als Fifo(!) aller auszuführenden Commands * in OnBusy neue Abfrage: if 0 < len(self.TxCommands)): und * mit und: if not(IsWaitingForResponse()): * -> pop next command und push TxLines, Set WaitingResponse := command (-> isWaiting!) ==== 220221: SCD - TimeOut ==== * NC caller eleminiert * TimeOut-Error bei UartCB-Unterbrechung * Error-Condition kann ich im Moment nicht ohne Folge-/Abbruch-Fehler einbauen -> ohne Error !!! * Event wieder einbauen - Problem Scriptor und Hardware! ==== 220221: SCD - Chain Error ==== * SCDHardware einfügen (von SCDController übernehmen) * entfernt: unnötiger Filter in TxLine * Version: {{:project::SCD_ScriptingCommandDispatcher:2202211918_ScriptingCommandDispatcher_03V02_fullchain.zip | 2202211918_ScriptingCommandDispatcher_03V02_fullchain.zip}} ==== 220220/21: SCD - Software-Emulation Neue Version ==== * SCDCommander: @, $, kein ! * SCDController: @, $, kein ! * neue gemeinsame Dispatcher-Class * DEF.Error : globale Fehlerfunmktion eingebaut (später: System-Reset?) * Version: 541 * COM21 und COM22 * Version: {{:project:SCD_ScriptingCommandDispatcher:2202210859_ScriptingCommandDispatcher_03V00.zip | 2202210859_ScriptingCommandDispatcher_03V00.zip}} ==== 220219: SCD - Hardware (Software-Emulation) ==== * Angleichung SCDHardware an SCDController * weiter Usb-Ftdi-Adapter (COM52) für SCDHardware * Fehler Response: Entweder Command finished oder weiterleiten! * Sicherung 420 : * Versuch, alle unnötigen Ausgaben zu eleminieren mit DEBUG_ Konstanten! * Aufgabe - Neuanfang! ==== 220219: SCD - Response ==== * neue alleinige SCD-Programmierung ohne HW * Versuch zur Symmetrisierung SCDHardware, SCDController * kein Durchblick -> neuer Versuch: * Einbau Template $-Response in SCDController * Dispatcher... -> Dispatcher ==== 220218: SCD - Response ==== * in allen Devices $-Response als Antwort auf @-Command einbauen * SCDCommander: * DispatcherThread mit Software-HS für RxLines und TxLines * Fehler in UartUC-Chain: Hänger (_last) * neue alleinige SCD-Programmierung ohne HW ==== 220218: SCD - Integration Hardware ==== * Esp32SCDHardware * Weiterleitung der !HA SLS On/Off * Version: {{:project:SCD_ScriptingCommandDispatcher:2202180859_Esp32SCDHardware_01V01.zip | 2202180859_Esp32SCDHardware_01V01.zip}} * Ringabbruch in Hardware (nicht Scriptor) (diesen Wiederholungsabbruch in alle SCDs einbauen!!! * Version: {{:project:SCD_ScriptingCommandDispatcher:2202180919_ScriptingCommandDispatcher_02V11_commandchain.zip| 2202180919_ScriptingCommandDispatcher_02V11_commandchain.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2202180922_Esp32SCDHardware_01V02_commandchain.zip | 2202180922_Esp32SCDHardware_01V02_commandchain.zip}} ==== 220217: SCD - Integration Hardware ==== * Esp32UnoBoard mit MicroPython * Ersatz für Hardware-Controller (SCDHardware) -> eine UartUC * uP-Software: Minimaler Dispatcher mit @ LSO/LSF: * @H LSO : LedSystem On * @H LSF : LedSystem Off * Version: {{:project:SCD_ScriptingCommandDispatcher:2202172032_Esp32SCDHardware_01V00_ledonoff.zip | 2202172032_Esp32SCDHardware_01V00_ledonoff.zip}} * Version: {{:project:SCD_ScriptingCommandDispatcher:2202162059_ScriptingCommandDispatcher_02V10.zip | 2202162059_ScriptingCommandDispatcher_02V10.zip}} ==== 220216: SCD - "Fertigstellung" PC-Software ==== * X SCDCommander (UartPC:COM21) * X SCDController (UartPC:COM22 | UartUC:COM51) * X SCDHardware (UartUC:COM52) * X SCDScriptor (UartUC:COM53) * Symmetriesierung aller Scripte * Starten der Applications: SCDCommander -> SCDController -> SCDHardware -> SCDScriptor * {{:project:SCD_ScriptingCommandDispatcher:2202161159_ScriptingCommandDispatcher_02V05_quadsequence.zip | 2202161159_ScriptingCommandDispatcher_02V05_quadsequence.zip}} * Forward von !PA SLS On/Off an alle Devices!!! * {{:project:SCD_ScriptingCommandDispatcher:2202161522_ScriptingCommandDispatcher_02V06_eventalldevices.zip | 2202161522_ScriptingCommandDispatcher_02V06_eventalldevices.zip}} * LedSystem to all Devices * {{:project:SCD_ScriptingCommandDispatcher:2202162059_ScriptingCommandDispatcher_02V10.zip | 2202162059_ScriptingCommandDispatcher_02V10.zip}} {{:project:SCD_ScriptingCommandDispatcher:2202170838_DeviceManagerComPorts.png?300|2202170838_DeviceManagerComPorts.png}} {{:project:SCD_ScriptingCommandDispatcher:2202170829_UsbUartPCSimulation.jpg?500|2202170829_UsbUartPCSimulation.jpg}} ==== 220215: SCD ==== * Minimalsystem: * SCDCommander(UartPC, COM21): OnOpen, OnClose, OnRx, OnTx * SCDController(UartPC, COM22): OnOpen, OnClose, OnRx, OnTx * ScriptingCommandDispatcher133 * btnTxLSO/F - OHNE UartPC! - LedSystemOn/Off * lokal: LSO/LSF * erweitern: !PA LSO/F -> auch nüber UartUC an alle Devices * last: ScriptingCommandDispatcher136 ==== 220215: SCD ==== * (erste Morgenübungen!) * Neuer Versuch zur Defintion eines Tx-/Rx-Protokolls * ----------------------------------------------------- * Command(@) / Response($): * ----------------------------------------------------- * Command S -> T * S(Tx)<@ST C PI> * D0 * DJ(Rx)<@ST C PI> : * if DJ == T : * Execute * Response T(Tx)<$ST C PI> * else Forward DJ(Tx)<@ST C PI> * ... * DI(Rx)<$ST C PI> * if DI == S(!) : * Finish Command * else Forward DI(Tx)<$ST C PI> * ... * Spezialfall: Bridge (UartPC : UartUC) * wird behandelt wie Element einer SingleChain * ... * ----------------------------------------------------- * Event(!)(Target): * ----------------------------------------------------- * S(Tx) * ----------------------------------------------------- * Event(All): * ----------------------------------------------------- * S(Tx) ==== 220214: SCD ==== * (erste Morgenübungen!) * Einschub: TxD> -> UartPC-TxD / UartUC-TxD> * Einschub: RxD> -> UartPC-RxD / UartUC-RxD> * Neue Commands in SCDCommander: * @PP LSO/LSF - PC-UartPC-PC: ein/ausschalten der PC-LedSystem * @PC LSO/LSF - PC-UartPC-UC: ein/ausschalten der UC-LedSystem * @PH LSO/LSF - PC-UartPC-UC - UC-UartUC-HC: ein/ausschalten der HC-LedSystem * umbau WNDCommander auf sechs Buttons * grosses Problem: * Übersichtlichkeit der Tx/Rx-Daten geht verloren, * Notwendig ist ein neues Konzept/Modell zum Datentransfer über UartPC und UartUC !!!!!!! ==== 220213: SCD - ==== * Erster Zugriff von SCDCommander -> UartPC -> SCDController -> UartUC -> SCDHardware * {{:project:SCD_ScriptingCommandDispatcher:2202132027_ScriptingCommandDispatcher_02V04_threeuctwobusses.zip | 2202132027_ScriptingCommandDispatcher_02V04_threeuctwobusses.zip}} ==== 220212: SCD - ==== * Erweiterung von UartPC -> UartPC und UartUC * Umbenennung: symbole: * P - PC-Commander (P) * I - Esp32-Interface-Controller (uP, C++) * H - Stm32-Hardware-Controller (C++) * S - RPiPico-Scriptor (uP) * Command Commander: <@HLSO -> Controller: LSO ==== 220212: SCD - ==== * Commander: Tx:"@HC LSO" -> Controller: Rx:"@HC LSO" Tx:"$CH LSO" und Tx:"!CH SLS On" * Commander: Tx:"@HC LSF" -> Controller: Rx:"@HC LSF" Tx:"$CH LSF" und Tx:"!CH SLS Off" * Problem: return OnTx mit Rückgabeparameter txline beseitigt * {{:project:SCD_ScriptingCommandDispatcher:2202131112_ScriptingCommandDispatcher_02V03_UartPC.zip | 2202131112_ScriptingCommandDispatcher_02V03_UartPC.zip}} ==== 220212: SCD - ==== * Tx / Rx / !-Response * def TxCommand(self, source, target, command) * def TxResponse(self, source, target, response) * def TxEvent(self, source, target, event) * bisher direkte TxRx-Reflexion, nun * SCDController (neben SCDCommander) * int Commander: Tx:"@HC LSO" -> Controller: Rx:"@HC LSO" Tx:"$CH LSO" und Tx:"!CH SLS On" * int Commander: Tx:"@HC LSF" -> Controller: Rx:"@HC LSF" Tx:"$CH LSF" und Tx:"!CH SLS Off" * {{:project:SCD_ScriptingCommandDispatcher:2202121954_ScriptingCommandDispatcher081ledonoffhc.zip | 2202121954_ScriptingCommandDispatcher081ledonoffhc.zip}} ==== 220211: SCD - ==== * Vorbereitung KaLi - RRC ==== 220210: SCD - ==== * Aufräumen, _Esp32RobotCarController * **ScriptingCommandDispatcher**: **SCDCommander**, **SCDController**, **SCDHardware**, **SCDScriptor** * Umbennung: **_PcScriptingCommandDispatcher** -> **_ScriptingCommandDispatcher** (da alle 4 Applikation parallel behandelt werden) * Basis: 2202091649_PcScriptingCommandDispatcher_02V02 -> ScriptingCommandDispatcher * SCD(alle4): Uart * SCD(alle4): Dispatcher * Uart: erhält RxLines und TxLines * Uart-OnRxLine(-) : RxLine muss im Parent-Module gepopt werden * Uart-OnTxLine: muss (eventuell geänderte Line als return an Uart zurückgeben * 1. in UartThread RxLins(!) aufstocken, solange Zeichen in Rx available * 2. Abfrage auf zu sendende TxLines * 3. Abfrage auf vorhandene RxLines (vgl.1.!) -> OnRxLine * SCDCommander: Tx und Rx ok, jetzt Analyse Rx: S, T, C ==== 220209: SCD - Aufteilung vier Applikationen ==== * jede Application bekommt eine wählbare Monitorposition * jede Application bekommt eine (wählbare) Uart * automatischer Programmstart aller vier Applikationen * automatische Plazierung aller vier Applikationen * Version: {{:project:SCD_ScriptingCommandDispatcher:2202091649_PcScriptingCommandDispatcher_02V02.zip | 2202091649_PcScriptingCommandDispatcher_02V02.zip}} ==== 220209: SCD - NeuFormulierung ==== * jede Device erhält eigene (Simulations-)Application * Aufsplittung von PcScriptingCommandDispatcher -> * PC: SCDCMD - SCDCommander (UartPC/WlanUdp/BtUart/LanUdp) * UC: SCDCNT - SCDController (UartPC/WlanUdp/BtUart/LanUdp), (UartUC) * UC: SCDHDW - SCDHardware (UartUC) * UC: SCDSCR - SCDScriptor (UartUC) ------------------------------------- SDCCMD: COM21 UartPC: TxA RxA | | SDCCNT: COM22 UartPC: RxB TxB ------------------------------------- SDCCNT: COM31 UartUC: RxC TxC | | SDCCMD: COM32 UartUC: | RxD TxD | | SDCSCR: COM33 UartUC: TxE RxE ------------------------------------- ==== 220208: SCD - Formulierung ==== * X Basis: 2202071952_PcScriptingCommandDispatcher_02V02 * X Umbenennung: CMD, SCR, CTR, HDW * Uart-Umformulierung (Weiterführung von gestern): * RxLines * TxLines ==== 220208: SCD - Theorie ==== * Project: enhält eine bis mehrere Devices * Device: enthält Units: ein Processor, eines oder mehrere Interfaces, einen Dispatcher * Processor: verteilt die ProcessTime auf die Aufgaben der Units auf * Interface: Datenschnittstelle zwischen Local-Device und External-Devices * Dispatcher: * RxLine: Dispatcher erhält vom Interface RxLines, sammelt und verarbeitet diese lokal an Subdevices oder leitet die RxLines über UartUC-Bus an andere Devices weiter * TxLine: Dispatcher erhält von SubDevices TxLines und gibt diese über Interfaces oder UartUC-Bus weiter * SubDevices: logische Segment der übergeordneten Device * DatenTypen: * @ Commands * $ Response * ! Event ==== 220206: RRC - PC:RobotCarCommander und Esp32RobotCarController ==== * PcPcScriptingCommandDispatcher * UartPC(COM51) * UartUC(COM52) * btnWindowSize 4x * btnWindowPosition 4x ==== 220206: RRC - PC:RobotCarCommander und Esp32RobotCarController ==== * einfachste "schnelle" Vorgehensweise: * Esp32 missbrauchen als Esp32Scriptor * Hardware: auf Uart1: UartUC (Uart2: UartPC, Uart0: Usb-Program&Debug-Interface) * --------------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbPC)->-UartPC->(UartPC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbPC)<-UartPC-<-(UartPC)Tx:Esp32MultiInterfaceDispatcher * --------------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbUC)->-UartUC->(UartUC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbUC)<-UartUC-<-(UartUC)Tx:Esp32MultiInterfaceDispatcher * --------------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbPC)->-UartUC->(UartPC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbPC)<-UartUC-<-(UartPC)Tx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Tx(UsbUC)->-UartUC->(UartUC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbUC)<-UartUC-<-(UartUC)Tx:Esp32MultiInterfaceDispatcher * --- Distribution ------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbPC)->-UartPC->(UartPC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbUC)<-UartUC-<-(UartUC)Tx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Tx(UsbUC)->-UartUC->(UartUC)Rx:Esp32MultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbPC)<-UartPC-<-(UartPC)Tx:Esp32MultiInterfaceDispatcher * --- Distribution ------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbPC)->->->(UartPC)Rx:Esp32MultiInterfaceDispatcher * Esp32MultiInterfaceDispatcher:Rx(UartUC)<-<-<-(UartPC)Tx:Esp32MultiInterfaceDispatcher * Esp32MultiInterfaceDispatcher:Tx(UartUC)->->->(UsbPC)Rx:PCMultiInterfaceDispatcher * --- Distribution ------------------------------------------------------------------- * PCMultiInterfaceDispatcher:Tx(UsbPC)->->->(UartPC)Rx:Esp32MultiInterfaceDispatcher * Esp32MultiInterfaceDispatcher:Rx(UartUC)<-<-<-(UartPC)Tx:Esp32MultiInterfaceDispatcher * Esp32MultiInterfaceDispatcher:Tx(UartUC)->->->(UsbUC)Rx:PCMultiInterfaceDispatcher * PCMultiInterfaceDispatcher:Rx(UsbPC)<-<-<-(UsbUC)Tx:PCMultiInterfaceDispatcher ==== 220205: RRC - PC:RobotCarCommander und Esp32RobotCarController ==== * Konzepte formuliert: * VSCode mit zwei MicroPython-PyMakr-Projekten (und zwei Schnittstellen-unterschiedlichen) pymakr.conf erfolgreich wechselseitig eingesetzt * O KeyEvent checken * Esp32RobotCarController(MicroPython): Interfaces: UartPC/BtUart/WlanUdp und UartUC(UCBus) * Weiterleiten von Commands an Esp32RobotCarController(Tx)->UartUC->(Rx)Stm32RobotCarController(C++) * Responses und Events weiterverteilen: Stm32RobotCarController(C++)(Tx)->UartUC->(Rx)Esp32RobotCarController - funktioniert: PCGui(Python)->Button(LedOn/Off)->UartUsb->Esp32(MicroPython): LedOn/Off \\ - jetzt: PCGui(Python)->Button(LedOn/Off)->UartUsb->Esp32(MicroPython)->UartUC->Stm32(C++): LedOn/Off * Trick: statt Stm32F103C8T6(C++) besser Esp32(uP) wegen Umstellung von VSCode (C++ <-> PyMakr) ==== 220205: RemoteRobotCar - RobotCarCommander ==== * COM40 - UartProgramDebug, Program&Debug-Interface PC-ESP32 * COM3 - UartPC, Command-Response-Interface PC-ESP32 * COMx - UartUC, nur mit Einheiten des UartUC-Busses (Chain) verbunden! * X Dispatcher: SystemTimeManagement * X Esp32RobotCarController.py * X Esp32RRCallbacks.py * X Esp32RRCDispatcher.py * X Esp32RRCGlobals.py * X LSO, LSF funktionieren... * X bei Response: Rx:S-T -> Tx:T-S * X StateLedSystem -> GUI Led: red <-> grey * Version PC: {{:project:SCD_ScriptingCommandDispatcher:2202051214_RobotCarCommander_01V00.zip | 2202051214_RobotCarCommander_01V00.zip}} * und ESP32: {{:project:SCD_ScriptingCommandDispatcher:2202051214_Esp32RobotCarController_01V00.zip | 2202051214_Esp32RobotCarController_01V00.zip}} ==== 220204: RemoteRobotCar - RobotCarCommander ==== * OOP-HW-Classes ==== 220203: RemoteRobotCar - RobotCarCommander ==== * OOP-Hierachy * RRC * MotorL * MotorR * EncoderL * EncoderR * DistanceFL * DistanceFR * DistanceBL * DistanceBR * an alle Module des RRC wird CB-Methodenliste(Rx/Tx...) übergeben * Main: * OnRxCommand(@) * OnTxCommand(@) * OnRxResponse($) * OnTxResponse($) * OnRxEvent(!) * OnTxEvent(!) * OnRxComment(#) * OnTxComment(#) ==== 220202: RemoteRobotCar - RobotCarCommander ==== * PC-Gui, Python, Spyder * Transfer zwischen * PC: {{:project:SCD_ScriptingCommandDispatcher:2202021600_RobotCarCommander_00V00.zip | 2202021600_RobotCarCommander_00V00.zip}} * und ESP32: {{:project:SCD_ScriptingCommandDispatcher:2202021600_Esp32RobotCarController_00V05.zip | 2202021600_Esp32RobotCarController_00V05.zip}} ==== 220201: RemoteRobotCar - RobotCarController==== * CBMotor - BaseClass mit allen Motor-Methoden * CHMotor - Motor-Methoden -> Motor-Funktion Hardware * CSMotor - Motor-Methoden -> Motor-Simulation Software * RobotCar : Sammel-Class für H/S-Motor, H/S-Encoder, H/S-Distance * BRobotCar * HRobotCar * HMotor(BMotor) * HEncoder(BEncoder) * HDistance(BDistance) * SRobotCar * SMotor(BMotor) * SEncoder(BEncoder) * SDistance(BDistance) * <@HE APR> / <@HE LSO> / <@HE LSF> funktionieren * Version: {{:project:SCD_ScriptingCommandDispatcher:2202011711_Esp32RobotCarController_00V01.zip | 2202011711_Esp32RobotCarController_00V01.zip}} * X Wiedereinbau: LCDisplayI2C * X Wiedereinbau: Keyboard4x4 * Version: {{:project:SCD_ScriptingCommandDispatcher:2202011733_Esp32RobotCarController_00V02.zip | 2202011733_Esp32RobotCarController_00V02.zip}} * Erweiterung: Simulation Motor/Encoder(/Distance) mit Commands und Simulationsfunktion * Version: {{:project:SCD_ScriptingCommandDispatcher:2202012135_Esp32RobotCarController_00V04_motorencodersimulation.zip | 2202012135_Esp32RobotCarController_00V04_motorencodersimulation.zip}} ==== 220201: RobotCarController - AddOn: Simulator ==== * Compiler-Directive: ACTIVE_SIMULATOR * Software-Simulator: CSimulatorMotor (entsprechend: CSimulatorEncoder/Distance...) * CMotor -> CSimulatorMotor(Main) : Bestandteil des Main-Programms * Callbacks bei Motor-Funktonen(Move, Stop -> Main -> CSimulatorMotor) ==== 220131: DCMotor... -> RC...==== * RCController - RobotCarController * RCSimulator * RCScriptor * RCCommander ==== 220131: DCMotorController ==== * Esp32UnoBoard (Symbol: E) mit MicroPython(tiny-Version), später Cplusplus(pro-Version) * Software Basis: 2201232053_Esp32ScriptingCommandDispatcher_01V11_base * Entfernung des Scripting-Interface - hier nur reine RxCommand-Verarbeitung * VSCode mit Pymakr, COM20 * MP-Image-Installation mit Thonny: {{https://micropython.org/download/esp32/ | v1.18(2022-01-17).bin}} * RxCommands: * @E LSO : LedSystemOn * @E LSF : LedSystemOff * @E MML : MoveMotorLeft * @E MMR : MoveMotorRight * @E SML : StopMotorLeft * @E SMR : StopMotorRight * @E STP : StopAllMotors * @E RSD : ReadSensorDistance * Sensor- in Front(left, middle, right): , , * Sensor- in Middle: , , * Sensor- in Back: , ,
* Sensor- in Front(all): := [ ] * Sensor- in Middle(all): := [ ] * Sensor- in Back(all): := [
] ==== 220130: DCMotorSriptor: Done ==== * X UI-Aufteilung in zwei Tabsheets: Terminal und FileHandler * X Software-Handshake TxData-RxData: * Erkennung eines TXCommands * Senden des TxCommands über UartUC, warten auf Antwort * Empfang eines RxResponse, Beendung des TxCommands * X Script-Verarbeitung: * exec(open(scriptname).read()), exec im ...ScriptorMain(globals(), locals()) * Execution einer (OOP-)Hierachie von (Micro-)Python-Scripts * Jeder TxCommand wird in einer Class-Method als Todo->UartUC gesendet * Software-Handshake jedes TxCommands * X Version: {{:project:SCD_ScriptingCommandDispatcher:2201301949_DCMotorScriptor_00V11.zip | 2201301949_DCMotorScriptor_00V11.zip}} ==== 220129: DCMotorSriptor: ToDo ==== * Drei PC-Programme mit Austausch über UartUC-Bus: * DCMotorCommander * DCMotorSimulator * DCMotorSriptor * PC, Python: aus DCMotorSimulator(PC) ScriptingFileInterface extrahieren und * in eigenes PC-Programm packen: DCMotorSriptor * später Transfer: (PC)DCMotorSriptor -> RPiPicoDCMotorSriptor * DCMotorCommand -> Command -> DCMotorSriptor * DCMotorSriptor enthält Commands für ScriptingFileInterface: * XSF - Execute: Scriptor empfängt Command zur Ausführung eines lokalen Scripts * @ST XSF