esp_slip_router icon indicating copy to clipboard operation
esp_slip_router copied to clipboard

Can't show console command

Open hanyuzzw opened this issue 6 years ago • 24 comments

Excuse me! Follow your steps, whether I configure the SLIP interface with :

    `IP4_ADDR(&netmask, 255, 255, 255, 0);
     IP4_ADDR(&gw, 127, 0, 0, 1);
     netif_add (&sl_netif, &config.ip_addr, &netmask, &gw, &int_no, slipif_init, ip_input);
     netif_set_up(&sl_netif);`

or with:

    `IP4_ADDR(&netmask, 255, 255, 255, 0);
     IP4_ADDR(&gw, 192, 168, 240, 2);
     netif_add (&sl_netif, &config.ip_addr, &netmask, &gw, &int_no, slipif_init, ip_input);
     netif_set_up(&sl_netif);`

it always can't show the console CMD after I run:

   `sudo slattach -p slip -s 115200 /dev/ttyUSB0 & sudo ifconfig sl0 192.168.240.2 pointopoint 
    192.168.240.1 up mtu 1500
    sudo telnet 192.168.240.1 7777`
    // telnet connection time out!!!

why?

hanyuzzw avatar Jun 13 '18 07:06 hanyuzzw

But you also set IP4_ADDR(&ipaddr, 192, 168, 240, 1); on the ESP?

The telnet only works if you have a server running on the ESP. If you are referencing the simple example, the only thing you can do is pinging. Does the user_simple work for you?

martin-ger avatar Jun 13 '18 09:06 martin-ger

yes, the config.ip_addr is 192.168.240.1, and I compiled with the user not the user_simple. I succeed one time, but I can't reappear it any more .
And if I use user_simple, the esp led is blinking all the time, and

`$ ping 192.168.240.1
PING 192.168.240.1 (192.168.240.1) 56(84) bytes of data.

 ping: sendmsg: No buffer space available  
 ping: sendmsg: No buffer space available  
 ping: sendmsg: No buffer space available  
 ping: sendmsg: No buffer space available  
 ping: sendmsg: No buffer space available  
 ping: sendmsg: No buffer space available
`  

but ping other ip is ok.

the configuration of slip interfance is:

   `sl0       Link encap:Serial Line IP    
               inet addr:192.168.240.2  pointtopoint :192.168.240.1  netmask:255.255.255.255`

hanyuzzw avatar Jun 13 '18 12:06 hanyuzzw

Could you try to use the precompiled binaries first?

Also please try the following procedure first: Sometimes, there is a wrong or non-matching version of "esp_init_data_default.bin" in the flash. If the firmware files from above flash correctly but after reboot you see only garbage on the serial and/or the LED on GPIO2 is flashing rapidly, try to re-initialize this sector: download https://github.com/martin-ger/esp_wifi_repeater/raw/master/firmware/esp_init_data_default_v08_vdd33.bin and flash it to 0x7c000 for 512 kB modules (some ESP-01, Sonoff Switch), 0xfc000 for 1 MB modules (most ESP-01), or 0x3fc000 for 4 MB modules (most ESP-12, Wemos D1).

martin-ger avatar Jun 13 '18 16:06 martin-ger

Just uploaded a new version (plus binaries) that already include the esp_init_data_default.

martin-ger avatar Jun 14 '18 09:06 martin-ger

Thanks for your reply,and if I want to test IPv6,where the lwip should I modify ,on /esp-open-sdk/sdk? on /esp-open-sdk/esp-open-lwip? on standalone sdk ESP8266_NONOS_SDK-2.1.0-18-g61248df or all of them?

hanyuzzw avatar Jul 02 '18 07:07 hanyuzzw

Neither the open-sdk nor the NONOS_SDK provide any working IPv6 support. Already tried to work on this, but this is a real heroic job...

If you want to start with IPv6 on the ESP8266, the FreeRTOS is probably the best choice. Here is a project of my students as a starting point: https://github.com/IPv6-ESP8266/IPv6-ESP8266

martin-ger avatar Jul 02 '18 07:07 martin-ger

Thank you very much and I will try it.

hanyuzzw avatar Jul 02 '18 07:07 hanyuzzw

i got the worse issues too mine is a board Nodemcu lolin and after i flashed the prebuilt binaries, i cant telnet to the target ip 192.168.240.1 also can not ping that ip

yunfan avatar Feb 27 '19 03:02 yunfan

I just checked the binary yesterday - for me it worked. Did you flash in DIO mode? Did you download the binaries with the browser? Sometimes they get corrupted by an CR/LF issue. Best is downloading the zip and extracting them.

The slip_router is a little bit hard to debug as it has no serial output. Just to check, whether flashing was all right, could you test to flash my "esp_mqtt" binariy with the same procedure? Try to connect to the serial console there. If this fails too, you probably have an issue with flashing or downloading...

martin-ger avatar Feb 27 '19 06:02 martin-ger

@martin-ger i guess i havnt use DIO mode, and i got the firmware by git clone https, might the problem you said

yunfan avatar Feb 28 '19 02:02 yunfan

@martin-ger btw, the wifi in my local dont share the same ssid with the default firmware, is this caused the problem? and is it possible to dynmic configuring the ssid and password?

yunfan avatar Feb 28 '19 02:02 yunfan

git clone is fine. You can configure the SSID once you have access.

Did you do the following procedure?

To connect a Linux-based host, start the firmware on the ESP, connect it via serial to USB, and use the following commands on the host:

sudo slattach -p slip -s 115200 /dev/ttyUSB0&
sudo ifconfig sl0 192.168.240.2 pointopoint 192.168.240.1 up mtu 1500

now

telnet 192.168.240.1 7777

gives you terminal access to the esp as router. On the ESP you then enter:

CMD>set ssid <your_ssid> 
CMD>set password <your_pw> 
CMD>set use_ap 0
CMD>save
CMD>reset

If so, when does it fail?

martin-ger avatar Feb 28 '19 06:02 martin-ger

@martin-ger i had down slattatch and ifconfig the only problem is cant telnet to that address also cant ping that ip

yunfan avatar Feb 28 '19 12:02 yunfan

did you check, whether you can flash other firmwares correctly?

martin-ger avatar Feb 28 '19 13:02 martin-ger

@martin-ger yes, i'd flashed punyforth later, which works as expected

yunfan avatar Mar 01 '19 01:03 yunfan

I have the same problem :( I have one of these https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/overview and managed to flash the pre-built firmware on the repo, and got a connection via telnet once, but can't connect anymore. Please help.

sardaukar avatar Jun 05 '19 14:06 sardaukar

Oops figured it out - I changed the bitrate with set bitrate but was still doing slattach at 115200!

sardaukar avatar Jun 05 '19 15:06 sardaukar

So I am having the same issue as @yunfan.

I am using your pre-built binaries. I've tried with two different ESP boards (A NodeMCU "0.9" / ESP12 and an ESP-01)

I can make your esp wifi repeater code work correctly and connect to its wifi access point.

But this project...after flashing I get a constantly blinking LED on GPIO0 and ifconfig shows that whilst I am transmitting data, I never recieve any.

I have tried connecting with a USB cable to the NodeMCU, and I've tried a cp2102 bridge to both boards.

I made sure to download the zip file to avoid potential corruption issues. The SHA1 sums that I calculate match your files.

The esptool.py version I have is 1.3-dev (latest from pip) and I am using a Mac running 10.14.5. My slattach tests are being done on a Raspberry Pi

Any ideas of what else I can try?

aladds avatar Jul 14 '19 08:07 aladds

I have now tried again doing the whole process on the raspberry pi with esptool 2.6 with the same results.

GPIO0 flashing, no data transmitted.

aladds avatar Jul 14 '19 09:07 aladds

Default netmask!!! The default netmask is 255.255.255.255.

If you configure this to pretty much anything else it works.

aladds avatar Jul 14 '19 19:07 aladds

Where do you think it should be configured?

martin-ger avatar Jul 14 '19 20:07 martin-ger

ifconfig.

For some reason, the version of Raspbian I have (latest buster release on a Pi 4) gave me that default netmask for sl0, so I couldn't talk to anything.

I solved it with:

sudo ifconfig netmask 255.0.0.0

aladds avatar Jul 14 '19 20:07 aladds

Got it working with my PowerBook 540c, if you're interested in my use:

https://68kmla.org/forums/index.php?/topic/57516-esp8266-wireless-without-another-computer/

aladds avatar Jul 14 '19 20:07 aladds

This is great!

When I did this, I really wasn't aware of all the applications in retro computing. Now I have them all: Atari, Amiga, 286 PCs and a PowerBook!

martin-ger avatar Jul 14 '19 22:07 martin-ger