good day dear experts
here i am back - again many many thanks dear jurai for the help!
many thanks for the reply and for your ideas - thanks for encouraging me to step ahead.
steps that have to be done:
i just have the car expect one command every second. If it does not receive one, it stops.
what do you think about this idea: i think that this is good idea - i like this idea!
regarding the connection type: i guess i can make use of the connection type that fits my existing hardware or use-case best. Once we have decided that, the search for a good connection library starts.
if i choose some [/b]roboremote or alike controlled solution:[/b]
well - if i want to go with some web-app or pc controlled thing then i should choose TCP/IP / WIFI or bluetooth ( with ESP 32)
regardingt the hardware:
firstly: I would say that i don't make use of an Uno and an esp-01 module. This makes life much more difficult. i think that i should choose a Wemos Mini D1 or a nodeMCU board. This will be smaller, cheaper and easier to use.
secondly perhaps i should choose a less old-fashioned motor driver than the 298. These will work well with 3.3V circuits, be more efficient and maybe use fewer pins (which may be important when using the Wemos/nodeMCU). What do you think about this idea.
btw regarding the use of MicroPython i have found an interesting approach here:
written by david golak:
How to build RC Car with the esp8266.
see the code esp8266/main.py at master · dgolak/esp8266 · GitHub
import machine
import time
LED_PIN=15
led=machine.Pin(LED_PIN,machine.Pin.OUT)
led.off()
LIGHT_PIN_L=13
light_l=machine.Pin(LIGHT_PIN_L,machine.Pin.OUT)
light_l.off()
LIGHT_PIN_R=2
light_r=machine.Pin(LIGHT_PIN_R,machine.Pin.OUT)
light_r.off()
class engines:
def
[b]see more at github[/b]
def main(E,micropython_optimize=False):
s = socket.socket()
ai = socket.getaddrinfo("172.20.10.10", 80)
addr = ai[0][-1]
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(addr)
s.listen(5)
while True:
res = s.accept()
client_sock=res[0]
if not micropython_optimize:
client_stream = client_sock.makefile("rwb")
else:
client_stream = client_sock
req = client_stream.readline()
get = req.split()[1].decode('utf-8')
if get == '/?action=forward':
E.forward()
elif get == '/?action=left_up':
E.left_up()
elif get == '/?action=right_up':
E.right_up()
elif get == '/?action=left_down':
E.left_down()
elif get == '/?action=right_down':
E.right_down()
elif get == '/?action=backward':
E.backward()
elif get == '/?action=stop':
E.stop()
elif get == '/?action=led_on':
led.on()
elif get == '/?action=led_off':
led.off()
elif get == '/?action=light_on':
light_l.on()
light_r.on()
elif get == '/?action=light_off':
light_l.off()
light_r.off()
else:
pass
while True:
h = client_stream.readline()
if h == b"" or h == b"\r\n":
break
if led.value() == 1:
led_icon="alarm_on.jpg"
else:
led_icon = "alarm_off.jpg"
client_stream.write(CONTENT % (wlan.ifconfig()[0],led_icon))
client_stream.close()
if not micropython_optimize:
client_sock.close()
main(E)
see esp8266/main.py at master · dgolak/esp8266 · GitHub
well i guess that this is a straingthforward approach...
cf: david golak:
How to build RC Car with the esp8266.
btw: my car has got a option of a steering axle - in other words - i have a slightly different car - than David has.
But that i think does not make a big difference.. I have to change the code at some places to fit.
i will have a closer look at this.
regards