Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telnet Connection Refused #93

Open
dankvitek opened this issue Oct 5, 2024 · 10 comments
Open

Telnet Connection Refused #93

dankvitek opened this issue Oct 5, 2024 · 10 comments

Comments

@dankvitek
Copy link

I was running juicepassproxy successfully 2/24-7/24, harvesting data for HA, but in July started getting connection refused from telnet.

Trying 10.26.20.33...
telnet: connect to address 10.26.20.33: Connection refused
telnet: Unable to connect to remote host

Ping still works fine, so I don't think it's a general routing issue to the Juicebox.

I tried a factory reset, but still no dice with telnet. The Juicebox local webserver console has this to say:

EnelX Web App Console - v3.1.5
> list
! # Type  Info
# 1 FILE  godaddy_ca.pem-1.0.0 (1390, 0)
> get ud
udp.client.auto_interface: default
udp.client.auto_retry: 0
udp.client.auto_start: 0
udp.client.local_port: 0
udp.client.remote_host: 
udp.client.remote_port: 3000
udp.server.auto_interface: default
udp.server.auto_start: 0
udp.server.data_gpio: -1
udp.server.lock_client: 0
udp.server.port: 3000
udp.server.remote_host: 
udp.server.remote_port: 0

This looks quite different than any other config I've seen. Note, my Juicebox has been blocked from accessing the internet since before the reset.

Any ideas on how to get the Juicebox back to a place where it can be used with juicepassproxy again?

@FalconFour
Copy link

FalconFour commented Oct 5, 2024

How odd, "EnelX web app console"? Hm.

Don't worry about the UDP client parameters, it doesn't use those in the ZAP system. Given that customized console string, I have zero doubt it's running ZAP firmware. Also curious you have a web console - that was removed/disabled long ago to save space. Maybe the WGM* module in JB2.x has those enabled?

Anyway, here are the relevant parameters:

running: JB1_0.zap
> ver
EMWERK-JB_1_1-1.4.0.28, 2021-04-27T20:39:50Z, ZentriOS-WZ-3.6.4.0
> get re
remote_terminal.enabled: 1
remote_terminal.interface: default
remote_terminal.password:
remote_terminal.port: 2000
remote_terminal.timeout: 60
>

Check those on yours. These are from my JB1.x unit, your version string will likely be very different.

@dankvitek
Copy link
Author

Thanks for the response Falcon, much appreciated. Looks like the remote_terminal option is not enabled on my box, which probably explains the inability to telnet into it.

EnelX Web App Console - v3.1.5
loading commands...
loading variables...
Ready.
> ver
EMWERK-JB201_V2-1.0.69, Gecko_OS-STANDARD-4.2.7-11064, WGM160P
> get re
remote_terminal.enabled: 0
remote_terminal.interface: default
remote_terminal.password: 
remote_terminal.port: 2000
remote_terminal.timeout: 60
> set remote_terminal.enabled 1
Set OK
> save
Success
> get re
remote_terminal.enabled: 1
remote_terminal.interface: default
remote_terminal.password: 
remote_terminal.port: 2000
remote_terminal.timeout: 60

This works, and I am able to telnet into the box. Cool!

However, after some time it starts refusing the telnet connection again, and when I log back into the console, I see that is has reverted back to remote_terminal.enabled: 0 on it's own accord.

Is there scheduled code running inside the box that resets this value? Like I said above, the box is no longer connected to the internet.

@FalconFour
Copy link

Agh... great. Well, the only way to know for sure would be to see if there's a recent firmware update posted to the 2.x boxes. ZAP twiddles a few settings on startup, and if so, it'd be really awful of them to have pushed out an update like that. It does those settings-twiddles on startup, and there are a handful of conditions (other than power cycle) that trigger a WiFi reboot, which would reload those forced settings. In my box, DHCP is one of them! So, no static IP will stick past a reboot...

Suppose that's on my goals list for next time I'm in the shop - fire up a JB2.0 board and see if I can get eyes on the latest firmware and its build date.

@dankvitek
Copy link
Author

Looking back at my HA data from jpp-- looks like the JB stopped playing nicely with jpp around June 5th. I had the JB connected to the internet until about a week ago. So it is possible a firmware update caused this.

If a firmware update really did brick the remote terminal on the JB, is the only way to recover from this to re-flash the firmware? I'm guessing OTA updates are not a thing.

Let me know if there is any other diagnostic information that would help troubleshooting this issue. Thanks.

@tomayac
Copy link

tomayac commented Oct 29, 2024

My (European) JuiceBox is on firmware ver. 3.1.2.0_JB3VU103 and it refuses to connect over telnet, but reacts on ping. In the app, it's identified as JuiceBoxProCell1PcableV1C2_7.4. This is the installer manual. They seem to have changed the password over-the-air, since the one from the manual (000000) doesn't work anymore, but I definitely could connect to its Web admin interface in the past. My suspicion is more and more that the US models are somehow different.

Logs
   await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.86.43', 2000)
[16:16:03] ERROR: Got unexpected response from the API: Service not enabled
--------------------------------
2024-10-29 16:16:04  INFO      [entrypoint.sh] Starting JuicePass Proxy

2024-10-29 16:16:04 INFO [entrypoint.sh] Docker Environment Variables:
2024-10-29 16:16:04 INFO [entrypoint.sh] DEVICE_NAME: JuiceBox
2024-10-29 16:16:04 INFO [entrypoint.sh] JUICEBOX_HOST: 192.168.86.43
2024-10-29 16:16:04 INFO [entrypoint.sh] LOCAL_PORT: 8042
2024-10-29 16:16:04 INFO [entrypoint.sh] DEBUG: true
2024-10-29 16:16:04 INFO [entrypoint.sh] UPDATE_UDPC: false
2024-10-29 16:16:04 INFO [entrypoint.sh] IGNORE_ENELX: true
2024-10-29 16:16:04 INFO [entrypoint.sh] EXPERIMENTAL: false
2024-10-29 16:16:04 DEBUG [entrypoint.sh] COMMAND: python3 /juicepassproxy/juicepassproxy.py --name JuiceBox --juicebox_host 192.168.86.43 --local_port 8042 --config_loc /config --log_loc /log --debug --ignore_enelx
2024-10-29 16:16:04 WARNING [main] Starting JuicePass Proxy v0.3.1 (Log Level: DEBUG)
2024-10-29 16:16:04 INFO [main] log_loc: /log/juicepassproxy.log
2024-10-29 16:16:04 INFO [main] config_loc: /config/juicepassproxy.yaml
2024-10-29 16:16:04 INFO [main] telnet timeout: 30
2024-10-29 16:16:04 INFO [main] ignore_enelx: True
2024-10-29 16:16:04 INFO [main] enelx_server: juicenet-udp-prod3-usa.enelx.com
2024-10-29 16:16:04 INFO [main] enelx_port: 8047
2024-10-29 16:16:04 INFO [main] local_addr: 172.30.33.6:8042
2024-10-29 16:16:04 INFO [main] enelx_addr: 158.47.1.128:8047
2024-10-29 16:16:04 ERROR [aiorun] Unhandled exception; stopping loop: 'Task exception was never retrieved'
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiorun.py", line 219, in new_coro
await coro
File "/juicepassproxy/juicepassproxy.py", line 483, in main
elif juicebox_id := await get_juicebox_id(
^^^^^^^^^^^^^^^^^^^^^^
File "/juicepassproxy/juicepassproxy.py", line 156, in get_juicebox_id
async with JuiceboxTelnet(
File "/juicepassproxy/juicebox_telnet.py", line 20, in aenter
if await self.open():
^^^^^^^^^^^^^^^^^
File "/juicepassproxy/juicebox_telnet.py", line 60, in open
self.reader, self.writer = await telnetlib3.open_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/telnetlib3/client.py", line 352, in open_connection
transport, protocol = await asyncio.get_event_loop().create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1121, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1103, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1006, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.86.43', 2000)
2024-10-29 16:16:04 INFO [aiorun] Entering shutdown phase.
2024-10-29 16:16:04 INFO [aiorun] Waiting for executor shutdown.
2024-10-29 16:16:04 INFO [aiorun] Shutting down async generators
2024-10-29 16:16:04 INFO [aiorun] Closing the loop.
2024-10-29 16:16:04 INFO [aiorun] Leaving. Bye!
2024-10-29 16:16:04 INFO [aiorun] Reraising unhandled exception
Traceback (most recent call last):
File "/juicepassproxy/juicepassproxy.py", line 590, in
run(main(), stop_on_unhandled_errors=True)
File "/usr/local/lib/python3.12/site-packages/aiorun.py", line 370, in run
raise pending_exception_to_raise
File "/usr/local/lib/python3.12/site-packages/aiorun.py", line 219, in new_coro
await coro
File "/juicepassproxy/juicepassproxy.py", line 483, in main
elif juicebox_id := await get_juicebox_id(
^^^^^^^^^^^^^^^^^^^^^^
File "/juicepassproxy/juicepassproxy.py", line 156, in get_juicebox_id
async with JuiceboxTelnet(
File "/juicepassproxy/juicebox_telnet.py", line 20, in aenter
if await self.open():
^^^^^^^^^^^^^^^^^
File "/juicepassproxy/juicebox_telnet.py", line 60, in open
self.reader, self.writer = await telnetlib3.open_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/telnetlib3/client.py", line 352, in open_connection
transport, protocol = await asyncio.get_event_loop().create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1121, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1103, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1006, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.86.43', 2000)

Not sure if it helps, but these are the API endpoints I have extracted from the Android app. Those definitely look different than the juicenet-udp-prod3-usa.enelx.com I can see in the above logs.

@ivanfmartinez
Copy link
Contributor

For devices that not work with telnet I recommend that you check other options like router redirect or DNS masquerade to point the Juicebox to JPP.

@FalconFour
Copy link

European JuiceBox Gen3? That's what the version string suggests. There's a whole huge number of unknowns there... you might have the entirely-new box that has very little if any relation to the JuiceBox as we know it, @tomayac :) Might be nice to pop it open and get photos to document it, but ... you may be blessed by native OCPP capability in the end, anyway!

@tomayac
Copy link

tomayac commented Oct 30, 2024

European JuiceBox Gen3? That's what the version string suggests. There's a whole huge number of unknowns there... you might have the entirely-new box that has very little if any relation to the JuiceBox as we know it, @tomayac :) Might be nice to pop it open and get photos to document it, but ... you may be blessed by native OCPP capability in the end, anyway!

Not sure how other JuiceBoxen look like, but this is mine:

IMG_5198

@FalconFour
Copy link

That looks so vastly different, it almost looks like it's made by a different company (and maybe it was) 😆

@tomayac
Copy link

tomayac commented Oct 31, 2024

Yeah, not sure where this leaves folks with such devices. It looks like juicepassproxy isn't necessarily going to be working without some changes for these models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants