TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC
  1. TMC is currently READ ONLY.
    Click here for more info.

Connecting with an incar web server (with no outside data connection)

Discussion in 'Technical' started by jordanthompson, Feb 18, 2020.

  1. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    I want to connect to a raspberry pi web sever while parked but the server will have no outside data connection (I want to be able to serve pages local to the pi)

    Currently, when I try to connect, theccar to the pi, I get:
    Could not connect to network
    Unable to obtain IP Address. Please check DHCP server settings.

    I have tried rebooting the car.
    The car connects fine with my 5g and 2g home networks.
    Yet I am able to connect to the pi with a laptop or cell phone.

    Any suggestions would be most helpful!
     
  2. jmaddr

    jmaddr Member

    Joined:
    Mar 29, 2019
    Messages:
    854
    Location:
    Florida
    Too little information to help here. I assume the pi is setup as a hotspot/access point? And you configured your Tesla to connect to that hotspot? Are you not seeing the SSID in the Tesla drop down? Or is the SSID hidden? If so, have you configured the SSID and PSK manually? Have you tried to unhide the SSID and see the car now sees it?
    I remember reading the antenna for the wifi is on one of the wing mirrors. Not sure how the aluminum and steel would affect signal nor how powerful the pi in AP mode can transmit. Try moving the pi out side the car and try again.
     
  3. idoco

    idoco Member

    Joined:
    May 7, 2013
    Messages:
    548
    Location:
    Outside Philly
    The Tesla browser won't connect to the RFC 1918 local address range. You need to change the IP address of the RP to something out of that range.
     
    • Informative x 1
  4. ewoodrick

    ewoodrick Well-Known Member

    Joined:
    Apr 13, 2018
    Messages:
    5,285
    Location:
    Buford, GA
    So you have a DHCP server running on the Pi?
    All the car is wanting is a IP address
     
  5. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    Correct
    Correct
    Correct
    I can see it
    Not a problem as I can access it from the center console as well as outside of the garage(!) I didn't realize the pi had that kind of range!
     
  6. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    Correct
    It is not connecting to the pi at all. I can see the SSID but cannot connect. My laptop and phone can connect to it.
     
  7. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    Thanks for the suggestion! This is probably the problem. What range should I be using?
     
  8. ewoodrick

    ewoodrick Well-Known Member

    Joined:
    Apr 13, 2018
    Messages:
    5,285
    Location:
    Buford, GA
    Because it can't get an IP address
     
  9. idoco

    idoco Member

    Joined:
    May 7, 2013
    Messages:
    548
    Location:
    Outside Philly
    Been a while since I hooked mine up. If you're just using it as access point for a local server an not passing any traffic beyond the RP then it doesn't matter. Just pick something not in the RFC1918 range.

    If you are using as a hotspot and passing traffic through to the internet then you need to configure it to not pass through the address your giving the RP. Can't remember which configuration file off hand(IPtables or Hostapd or sysctl).
     
  10. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    #10 jordanthompson, Feb 19, 2020
    Last edited: Feb 19, 2020
    I'm not home at the moment and cannot run any tests, but according to RFC 1918:
    "In Class A, 10.0.0.0/8 prefix range.
    Class A private IPv4 addresses starts from 10.0.0.0 to 10.255.255.255. 10.0.0.0/8 is the network IPv4 address and10.255.255.255 is the directed broadcast IPv4 address."

    My home range is 10.13.xxx.xxx and the car connects to it without any issues. I am not a network engineer and I am confused. Please explain...
     
    • Like x 1
  11. jordanthompson

    jordanthompson 2018 P100D Model X

    Joined:
    Apr 27, 2011
    Messages:
    589
    Location:
    Satellite Beach, FL
    Has no one connected to an in-car web server before?
     
    • Like x 1
  12. tamer_elmowafy

    Joined:
    Dec 25, 2019
    Messages:
    5
    Location:
    canada
    I am hosting an http server on my iphone and using it as a personal hotspot (default gateway address 174.20.10.1). can’t access the web server when the car is connected to the hotspot!
    is there a way around this?
    read that some Tesla owners do not have problems accessing local ips??!
    thanks
     
  13. idoco

    idoco Member

    Joined:
    May 7, 2013
    Messages:
    548
    Location:
    Outside Philly
    You are going to need to put an RP "in between" the phone and the browser. The RP acts as both an AP access point (for the browser) and a wifi client (for your IPhone wifi network). You need to configure the RP to pass all traffic through the IPhone WAN, except for the IP of the server which gets routed to the LAN.

    If you can it might be easier to just run the server on an RPI and not have to worry about the pass through.
     
  14. tamer_elmowafy

    Joined:
    Dec 25, 2019
    Messages:
    5
    Location:
    canada
    but in terms of the browser ability to access local ips ?? what ip range do suggest when setting up the pi AP...?!
    my browser can’t access any local ips in my home network! (192.168.2.x)....?!
    thanks
     
  15. idoco

    idoco Member

    Joined:
    May 7, 2013
    Messages:
    548
    Location:
    Outside Philly
    If you are using an RP and setting up your own DHCP on it you can use any network range you want. As long as it's not in RFC1918 range. Then either put your server on the RP and it give it a static IP address within that range. Or in the case where your server is on an IPhone, have the RP direct the "non-local" IP on the RP to the "local" IP on your IPhone.

    The trick is to pass all traffic from the LAN to the WAN except for the static IP address of your server. Otherwise you'll end up with the content of that address from the web.
     
  16. tamer_elmowafy

    Joined:
    Dec 25, 2019
    Messages:
    5
    Location:
    canada

    Thank u so much!
    new to rasbperry pi! which one do u suggest putting in the car ... 3b plus or the 4??
    do u suggest a specific kit?
    distro?

    thanks
     
  17. idoco

    idoco Member

    Joined:
    May 7, 2013
    Messages:
    548
    Location:
    Outside Philly
    Not an RP expert so can't comment. I used a 3 (not sure if A or B).
     
  18. tamer_elmowafy

    Joined:
    Dec 25, 2019
    Messages:
    5
    Location:
    canada
    thank you so much, will try that!
     
  19. appmirroring

    appmirroring Member

    Joined:
    Dec 11, 2020
    Messages:
    6
    Location:
    China
    The TeslaMirror app can run its web server on iOS and Android devices. As the older post said, "The Tesla browser won't connect to the RFC 1918 local address range." So for TeslaMirror app, the web server IP for iOS is 240.3.3.3, and the web server IP address is 3.3.3.3 for Android. Both 240.3.3.3 and 3.3.3.3 IP run on the mobile phone. I also heard that if the mobile router can set the network segment other than RFC 1918 local address range, it works for the Tesla connection too. Hope this will help.
     
    • Informative x 1

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC