Whenever the n_polling() function is called all GPIO pins i've setup will go to HIGH and turn on the relays. TL DR I tried setting up GPIO pins and expected them to be LOW which normally works when just doing this without an imported library. Start_handler = CommandHandler('start', start)ĭoes anyone know what i could do to fix this or what could be causing this, i've tried using multiple examples from the library's but both of them have the same unwanted behavior. Ive tried using different telegram bots but it does also happen with pyTelegramBotAPI.įor context: I'm using a Raspberry Pi Zero W with a Grove Base Hat.įrom telegram.ext import ApplicationBuilder, ContextTypes, CommandHandlerįormat='%(asctime)s - %(name)s - %(levelname)s - %(message)s',Īsync def start(update: Update, context: ContextTypes.DEFAULT_TYPE):Īwait _message(chat_id=update.effective_chat.id, text="I'm a bot, please talk to me!")Īpplication = ApplicationBuilder().token('TOKEN').build() I think it has something to do with the n_polling() function because whenever thats called the GPIO pins go from LOW to HIGH without sending the ouput request to do so. Whenever i load the telegram libray and i setup the GPIO pins they are set to HIGH while the default is LOW, this only happens when the library is imported. As you wrote you already have a WiFi uplink connection to your local internet router. Make sure your nf is in place then do sudo nano /etc/network/interfaces and add allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpasupplicant/nf to the end of the file. Then you should have an interface usb0 that you can use as an ethernet interface. While trying to set this up i've stumbled upon some weird GPIO behavior. First you have to connect the Raspberry Pi Zero W to your PC with an USB cable and use OTG Gadget ether emulation to get the USB connection emulated as an ethernet connection. I'm currently trying to control multiple relays with my Raspberry pi zero W through telegram. EDIT: While debugging i found out that something else is wrong and my GPIO pins might just be malfunctioning, looking into it more right now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |