-
Notifications
You must be signed in to change notification settings - Fork 12
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
Error messages when using juicebox_commands branch #90
Comments
This message format was not considered in the new routines. I have added it to my branch #69 will work with new version About the current_max_charging message, it will only stops after the message is parsed correctly, it occurs because HA tries to set default values to parameters, but the code can only do this after knowing the message format to be used with the device. |
I had the same two problems described by @niharmehta, when using the juicebox_commands branch (using docker label). Just now I manually added the two files (using docker volumes) from today's most recent commit, and that seemed to resolve the problem with "not valid juicebox message". But I still can't seem to get past the problem with initial values of current_max_charging and current_max. @ivanfmartinez I think I understand your description of the problem, but would you have any tips for resolving it? It seems to be blocking the message to the juicebox (unless I'm misinterpreting): 2024-10-03 16:30:22 WARNING [juicebox_mitm] Unable to send command to juicebox before current_max and current_max_charging values are set PS: thanks for all of your work on this! Pretty exciting, given yesterday's announcement. |
Thanks @ivanfmartinez for the quick fix! Hopefully the container for the branch will be updated soon. |
@awp0 that warning came from this part of code : https://github.com/snicker/juicepassproxy/pull/69/files#diff-8c66151797142880ff510b609d598b88cff39528d0845a1967dea7413cac9bdeR286 Only after having both parameters defined it will be able to send the responses to the device. This parameters will be set from the message that came from juicebox device or from being set from homeassistant. Normaly after the first message came from device they are defined. But this was tested with my device that send v09u messages. Looking in detail the message that was indicated here, it misses the "C" parameter. I have commited some more changes as workaround for this case. But considering that it is sending a different message maybe the responde should be different also. Will be very nice if we have a packet capture from this version talking with enel x servers to know the correct response. |
Thank you for the very fast turnaround @ivanfmartinez ! I consumed these new changes and started fresh in HA. The good news is that this indeed eliminates the error related to initial values. But it seems the Juicebox isn't accepting the command because when I attempt to change max charging current from HA, the response from Juicebox seems to indicate that it's still default. Here's what I see in the logs when I attempt to change Max Charging Current from default 40A down to 21A:
PS: I can attempt packet capture, but I'm not very experience with this. I'll investigate, but others can probably do it faster. |
@ivanfmartinez . Attached is a PCAP from the JB talking directly to the ENELX servers . (No JPP in the middle) . The car is out for a few hours , so I could not control charging or do too many changes to give more data. |
@niharmehta the capture that you sent shows you device on 192.168.237.4 sending UDP to the server on ports 8042 and 8047 , but I did not see responses from server. could you please try again and send a capture with responses from the enel x server ? @awp0 if you can capture also will give more sample data to check. At least in my device that uses v09u the responses are the one show on @awp0 log
|
Sorry about that. I did not noticed that the JB disconnected from the cloud while capturing. It was up when I started. Here is anotehr capture. After 2 minutes, just 10 packets back from the 158.X address all on 8042 .. No car is connected so all I attempted to do is set the current limit and back. I can post more captures later today. |
@niharmehta have you tried to set the limit to 29A ? and changed back to 40A ? I recommend that you try with juicepassproxy changing values, sometimes it can miss a setting if you send the command few instants before the juicebox send a new message. In this case you setting can be lost. Try changing both currrent parameters at diferent times, and sometimes for different values and save the juicepassproxy log to be checked in case of errors. As your device does not send the offline max current I dont know if it will really accept both parameters. |
Not sure if this is helpful, but here's the output of the following tcpdump command executed from my router, when I switch Maximum Capacity in the Enel app to 19A.
|
One difference between the proxy command and the Enel command is the timezone. To me it looks like the proxy sends the time (in the CMD block) in UTC regardless of container's timezone, but Enel is sending the time in my local time format. Is it possible that the Juicebox could reject a command that looks very different from its own clock? These two commands were issued less than 10 minutes of each other: Proxy: CMD42156A24M40C006S001!QPX$ <-- time sent is 2156 |
@awp0 maybe the device dont like the changes. The protocol have time and also a sequence number. As a suggestion try to turn off juicebox before each test (enel x server and juicepass server) |
Thanks @ivanfmartinez, no luck so far rebooting the machine. I've probably spent too much time today on this. Maybe tomorrow I'll see if I can figure out how to send a command to the device with correct time and high sequence number, just to see if one of those might be the cause of my problems. Thanks again for all of your work on this! |
@ivanfmartinez . I overrode the current juicebox-commands container with your two updated files . The error messages are no longer seen. As I think you were expecting with my current v7 protocol version, the Max Charging Current seems to be working using the slider in HA. The Max Current does NOT stay fixed at a reduced setting. |
@niharmehta as this device does not send the The juicepassproxy log showing where you send the new value and see what data the juicebox send back for some time maybe can help us to understand if this version are using different field to report the value. About the ENELX servers, that behaviour of not responding was what made me search for altenartives long time ago. Many people have this instabilitys with ENELX servers, mine became offline for many days and then started working again. After I put juicepassproxy to work I just ignored ENELX and had no problems with that. |
@ivanfmartinez , here are some logs from the docker log console . I made two attempts to set the slider in HA for Max Current.. First to 30, and then to around 21A. I see a message, then resets itself back to 40. Hope this is what you are looking for. |
@niharmehta the logs shows the new value are sent to the device. But it still does not send back new values. Possibilities :
This parameter is the "offline max current" which take effect after around 5 minutes that the device does not get responses from server. Maybe this older protocol devices uses a single parameter and dont have different current for offline, or use the rating current when offline. Only testing on the device to know. Also is important to know if the Max Charging current persists when device turned off, if it persists indicates that the value is saved on EEPROM which will give a recomendation to dont change that too much like the "Max Current" on newer devices. |
I see the same behavior as @niharmehta, for both max current and max charging current. I've fixed my timezone problem with the container, but it made no difference. Maybe it's a command sequence problem, but I've tried restarting everything with no success and I've run out of ideas. I can see the correct commands being sent to the JB (in the logs), but then the original value is read back into HA a few seconds later. I've tried it while charging the car, and I can see no change in charging rate. I'm stumped. Does anyone know if there's a simpler tool that would allow me to test custom commands directly to the JB (without HA or MQTT)? It would be interesting to experiment with higher sequence numbers or command strings. For example, when I was capturing packets from Enel, it was hard to understand the difference between C006 and C008. Edit to say that my JB is one of the older black metal boxes. |
@ivanfmartinez . Is there a specific test sequence you recommend to get the needed information back to you? I am checking to see if I can get by JB back connected directly to ENELX . Capture whatever packets you need, and then do the same with JPP to see if what the differences are. Best case, I can test using the app while JPP is in the middle, but I have not been able to get both working at the same time the last few days. Any other test recommendations ? |
The idea is to check if the changes are working. You should change parameters and check if the device responds. When we send the current change to juicebox it should give this information to the car, and then the car will reduce the current used. You can see the results on the car and also in the current used during charging. Normally this tests must be made before the car is near fully charged, because when near full charged maybe the car will use less than the juicebox devices maximum indicates. |
@awp0 the juicebox apparently does not have any way to receive commands, It open the UDP connection to the server and wait for commands in that connection. I think the easiest will be using HA and MQTT, there is a entity called "send_to_juicebox" on JPP, is disabled by default but should permit you to easily send data to juicebox, if you enable "data_from_juicebox" and "send_to_juicebox" in your homeassistant you should be able to make many tests. |
@ivanfmartinez
Next
In both of the captures with the JPP being a proxy, the logs indicate Max Charging Current changing, not Max Current. enelx_app_jb_max_current_p8042_mx_lan_1.pcap.zip |
Last one for now. I directed JB to connect directly to ENELX and then set the Current to 20A and let it stabilize. I then started JPP and redirected the JB to JPP in DNS and issued a reboot on the telnet CLI to restart the Zentri stack. I made no other changes within the app. When JPP first came up, the logs initially show 40A, but next it showed 20A which was the same still reflected in the app. Logs attached. |
@niharmehta thanks for the logs, I never seen that debug messages on my logs. I will make the changes to support this messages also. and when have more time will look in detail the captures also. Your tests show that the value set from the ENELX server is preserved after reboot. Have you tested the same thing turning off the energy on juicebox ? |
After powering down and up the JB, the setting is NOT preserved. Logs attached. |
This confirms that the device does not have an offline current or we dont know how to communicate correctly with this device :-) But at least with the online current control the device will work fine for most cases and will return to maximum after power lost. |
Once the JB connects back to ENELX, it drops to 20A (setting in app, so state is kept there). Actually quite concerning if I had a JB larger than the sized circuit when ENELX goes down. Depending on what the. captures indicate, it seems like ENELX does not have the capability either. Let me know if any other packet captures would be helpful. Anyways not a major issue, if I ever have a situation where this function matters, I will be getting a new EVSE. |
@niharmehta I agree that server can keep state information, but the best way to do this will be a refator on JPP to :
I'm not a experient python programmer neither used to the libraries that do the mqtt entities, this should be done after merging the commands branch by persons that know better how to do this in python my suggestion now for the users that have this limit case is to create an automation in HA that update the max charging current value after juicebox connect to JPP |
@niharmehta and @awp0 can you test with latest version ? @FalconFour indicated that the v07 works with offline current, just not report that. I think that my last commit is very safe, you just have to manually configure the offline current or wait at least 6 minutes to JPP get the offline current from the device. |
@ivanfmartinez , I tested the latest build this evening. Cleared HA, MQTT entries, and shut the JB down. Restarted the latest build . It took about 6 minutes and the Max Current Offline/ Wanted showed up! |
The good news is that setting the new image for the juicebox_commands branch seemed to work. Also, most of the read values I had before seem to be working. With the EXPERIMENTAL set to true, I see the number control in HA.
However, I am seeing a couple of errors in the logs that I am not sure about:
First, the NOT a valid JB message. Second seems to be a log entry about not having the current_max_charging set.
I did a quick search and did not find any other reports of this.
The text was updated successfully, but these errors were encountered: