Linux (raspbian) and the arduino IDE - not connecting to board for programming

so i'm trying to program my esp8266 from raspbian linux (raspberry pi 4b) with the arduino IDE, but it is failing to connect to the board.

I can read the serial output from the board with the serial monitor, reading ttyUSB0
i'm using IDE 1.8.17, not the build-in apt-get crap.
Running te IDE as root does not change anything.
Both users i tried it as are part of the dialout group
Online everyone seems to talk about the ttyACM0, i only have ttyUSB0 and ttyAMA0 as options. the ttyAMA0 does even less then the ttyUSB0

The troubleshooting page does not seem to give a solution, or i hve not found the correct page yet.
Any suggestions ? i'm a very average linux user, i normaly use it for webservers, databases and that sort of stuff...

Plugging the board into a windows machine, everything work just fine and as expected.

eror log:

Arduino: 1.8.17 Hourly Build 2021/09/06 02:19 (Linux), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

Executable segment sizes:
ICACHE : 32768 - flash instruction cache
IROM : 241396 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 27681 / 32768 - code in IRAM (IRAM_ATTR, ISRs...)
DATA : 1508 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 972 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 26008 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 271557 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28488 bytes (34%) of dynamic memory, leaving 53432 bytes for local variables. Maximum is 81920 bytes.
esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting......................................____Traceback (most recent call last):
File "/home/pi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in
esptool.main(cmdline)
File "/home/pi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 3552, in main
esp.connect(args.before, args.connect_attempts)
File "/home/pi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 529, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_
the selected serial port _
does not exist or your board is not connected

@callthedutch
Installation and Troubleshooting is for Problems with the Arduino itself NOT your project. It says so in the description of the section. Therefore I have moved your post here.

@Grumpy_Mike : it has to do with the connection between the IDE and the boards, not code/script, not the project i'm using it for, only the technical part of uploading my sketch to the board. how is that not installation and troubleshooting but project related ? asking so i can avoid the mistake in the future, because i'm clearly missing the logic behind the move..

i see it is not moved to "project" forums but interfacing with software on a pc. i figured this was for software other then the official IDE, so thats where it went wrong on my side. Thanks!

more info:

dmesg -T | grep tty
[Thu Oct 14 14:45:59 2021] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1920x1080M@50 smsc95xx.macaddr=E4:5F:01:04:DC:DF vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=ttyS0,115200 console=tty1 root=PARTUUID=bf7d0180-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[Thu Oct 14 14:45:59 2021] printk: console [tty1] enabled
[Thu Oct 14 14:46:00 2021] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 36, base_baud = 0) is a PL011 rev2
[Thu Oct 14 14:46:04 2021] ch341-uart ttyUSB0: break control not supported, using simulated break
[Thu Oct 14 14:46:04 2021] usb 1-1.3: ch341-uart converter now attached to ttyUSB0

Check if the issue is caused by recent kernel raspbian / Linux version, similar to

Try to downgrade the kernel version to see if it's OK.

@callthedutch take a look at Installing ESP8266 in Arduino IDE (Windows, Mac OS X, Linux) | Random Nerd Tutorials