Skip to content

Commit

Permalink
deneyap kart reseting upon serial startup
Browse files Browse the repository at this point in the history
setting DTR and RTS pins to low solved the issue
  • Loading branch information
kinkintama committed Nov 5, 2021
1 parent 5a91909 commit 15839ef
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions SerialMonitorWebsocket.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import asyncio
import json
import traceback

from utils import Data
import serial
import logging
import config

class aobject(object):
"""Inheriting this class allows you to define an async __init__.
Expand Down Expand Up @@ -84,13 +85,24 @@ def openSerialMontor(self, port, baudRate):
logging.info(f"Opening serial monitor")
if not self.serialOpen:
self.serialOpen = True
self.ser = serial.Serial(
port=port,
baudrate=baudRate,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=0)

self.ser = serial.Serial()
self.ser.baudrate = baudRate
self.ser.port = port

if Data.boards[port].fqbn == config.deneyapKart:
self.ser.setDTR(False)
self.ser.setRTS(False)

self.ser.open()

# self.ser = serial.Serial(
# port=port,
# baudrate=baudRate,
# parity=serial.PARITY_NONE,
# stopbits=serial.STOPBITS_ONE,
# bytesize=serial.EIGHTBITS,
# timeout=0)

async def sendResponse(self):
"""
Expand Down

0 comments on commit 15839ef

Please sign in to comment.