steve-community / steve

SteVe - OCPP server implementation in Java
GNU General Public License v3.0
801 stars 392 forks source link

I am using math -x OCPP1.6 library. I'm having trouble connecting. Any help would be appreciated. #1059

Closed jpily closed 1 year ago

jpily commented 1 year ago

Thank you for providing the test tool for free. I am using the math-x Arduino OCPP1.6 library and making several attempts to test the STeve server as a central system.

I successfully built the Steve server environment and it worked normally until build and run.

To test the math-x Arduino OCPP1.6 library, I made a charge box ID on the Steve server, and then set the math-x arduino ocpp library as follows.

#define OCPP_HOST "127.0.0.1" #define OCPP_PORT 9000 #define OCPP_URL "ws://127.0.0.1:9000/steve/websocket/CentralSystemService/test01" The result of the operation is [AO] info (.pio/libdeps/esp32-s3-devkitc-1/ArduinoOcpp/src/ArduinoOcpp/Core/OcppSocket.cpp:31): Disconnected Connection failed with the log that the socket communication connection is not made. there is. For reference, I did the following when creating a charge box id in Setve server. 1. menu dataManagement -> Charge point click -> click add New button -> enter add charge point contents -----Input contents ------ ChargeBox ID: test01 Insert connector status after start/stop transaction: check Insert connector status after start/stop transaction: Accepted
Street:test01 House Number :1234 zip code : 123456 city : seoul Country: Korea Description: dummey charge point Admin Address: www.test.com Latitude: 90 Longitude::90 ------------------------------------------ I entered this and clicked the Add button to add it. STeve server main.properties is set as follows: -------------------------------------------------- ------------- context.path = steve # Database configuration # db.ip = localhost db.port = 3306 db.schema = stevedb db.user = steve db.password = tech7975 # Credentials for Web interface access # auth.user = admin auth.password = 1234 # The header key and value for Web API access using API key authorization. # Both must be set for Web APIs to be enabled. Otherwise, we will block all calls. # webapi.key = STEVE-API-KEY webapi.value = 1234 # Jetty configuration # server.host = 127.0.0.1 server.gzip.enabled = true # Jetty HTTP configuration # http.enabled = true http.port = 9000 # Jetty HTTPS configuration # https.enabled = false https.port = 8443 keystore.path = keystore.password = # When the WebSocket/Json charge point opens more than one WebSocket connection, # we need a mechanism/strategy to select one of them for outgoing requests. # For allowed values see de.rwth.idsg.steve.ocpp.ws.custom.WsSessionSelectStrategyEnum. # ws.session.select.strategy = ALWAYS_LAST # if BootNotification messages arrive (SOAP) or WebSocket connection attempts are made (JSON) from unknown charging # stations, we reject these charging stations, because stations with these chargeBoxIds were NOT inserted into database #beforehand. by setting this property to true, this behavior can be modified to automatically insert unknown # stations into database and accept their requests. # # CAUTION: setting this property to true is very dangerous, because we will accept EVERY BootNotification or WebSocket # connection attempt from ANY sender as long as the sender knows the URL and sends a valid message. # auto.register.unknown.stations = false ### DO NOT MODIFY ### steve.version = ${project.version} git.describe = ${git.commit.id.describe} db.sql.logging = false profile=prod -------------------------------------------------- -------------------------------------------------- --- Any help would be appreciated.
phken91 commented 1 year ago

hi @jpily , i facing same issue with you, can you share your current working config here? thanks

jpily commented 1 year ago

Does Steve server work properly? You can do it the way I debugged it and made it work. Please meet the prerequisites to properly use the arduinoOCpp library.

  1. mysql local time command setting (whether it was executed once before, once again... unconditionally do) SET GLOBAL time_zone = '+00:00';

  2. Connect to the Stever server and create a virtual charging point. Steve server start-> menu Data management->charge point ->add new -> Create ChargeBox ID

  3. steve-master\steve-master\src\main\resources\config\prod\main.properties setup ex )
    ============================================\context.path = steve db is your own The most important is server.host, but don't use 127.0.0.1 and write the local ip.

db.ip = localhost db.port = 3306 db.schema = stevedb db.user = steve db.password = tech7975

auth.user = admin auth.password = 1234

webapi.key = STEVE-API-KEY webapi.value = 1234

server.host = 192.168.0.2 server.gzip.enabled = true

http.enabled = true http.port = 9000

https.enabled = false https.port = 8443 keystore.path = keystore.password =

ws.session.select.strategy = ALWAYS_LAST

auto.register.unknown.stations = false

steve.version = ${project.version} git.describe = ${git.commit.id.describe} db.sql.logging = false profile = prod

  1. ArduinoOcpp code host, port, url setting ex

    define STASSID "MySSID"

    define STAPSK "Ap_password"

define OCPP_HOST "220.110.22.35" // Set the IP given when connecting from outside, not the local IP

define OCPP_PORT 9000 // Steve server port

define OCPP_URL "ws://220.110.22.35:9000/steve/websocket/CentralSystemService/test01"

If it does not work after following the above steps, the port is not activated. If not, please contact us again. It's hard to answer because I'm at work.

phken91 commented 1 year ago

thanks for reply, i fixed this, by using simulator to help up debug

jpily commented 1 year ago

Did you check the meter value with arduino Occpp? Check on Steve server...

If you don't mind, could you share the entire code?

rathourcode commented 1 year ago

Did you check the meter value with arduino Occpp? Check on Steve server...

If you don't mind, could you share the entire code?

HAI Jpily, were you able to connect to websocket connection, if yes please help as i am unable to acess please help

jpily commented 1 year ago

I succeeded in connecting by doing the test myself

rathourcode commented 1 year ago

Can you please tell the steps you followed

On Wed, 19 Apr, 2023, 11:39 am jpily, @.***> wrote:

I succeeded in connecting by doing the test myself

— Reply to this email directly, view it on GitHub https://github.com/steve-community/steve/issues/1059#issuecomment-1514181774, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7GH3IGJVQ7MDA4TXOB5OWTXB56RFANCNFSM6AAAAAAU5SNT5U . You are receiving this because you commented.Message ID: @.***>

jpily commented 1 year ago

This is the first part to check. Please check first and tell me

  1. Check if the port you want to connect to is in the listening state

Run command prompt (cmd) -> netstat -ano Enter 127.0.0.1:port listening check

jpily commented 1 year ago

Have you finished installing Steve server? I'd like to know if Steve's server is running normally

rathourcode commented 1 year ago

yes

Have you finished installing Steve server?

yes

jpily commented 1 year ago

Secondly, the Steve server also needs to be configured. Copy what I'm uploading, put what's right for you, and edit it

Run main.properties in \steve-master\src\main\resources\config\dev and paste the code I give you and fix it

============ =======================

Just to be backwards compatible with previous versions, this is set to "steve",

since there might be already configured chargepoints expecting the older path.

Otherwise, might as well be changed to something else or be left empty.

# context.path = steve

Database configuration

# db.ip = localhost db.port = 3306 db.schema = stevedb db.user = steve db.password = 1234

Credentials for Web interface access

# auth.user = admin auth.password = 1234

The header key and value for Web API access using API key authorization.

Both must be set for Web APIs to be enabled. Otherwise, we will block all calls.

# webapi.key = STEVE-API-KEY webapi.value =

Jetty configuration

# server.host = 127.0.0.1 server.gzip.enabled = false

Jetty HTTP configuration

# http.enabled = true http.port = 8085

Jetty HTTPS configuration

# https.enabled = false https.port = 8443 keystore.path = keystore.password =

When the WebSocket/Json charge point opens more than one WebSocket connection,

we need a mechanism/strategy to select one of them for outgoing requests.

For allowed values see de.rwth.idsg.steve.ocpp.ws.custom.WsSessionSelectStrategyEnum.

# ws.session.select.strategy = ALWAYS_LAST

if BootNotification messages arrive (SOAP) or WebSocket connection attempts are made (JSON) from unknown charging

stations, we reject these charging stations, because stations with these chargeBoxIds were NOT inserted into database

beforehand. by setting this property to true, this behaviour can be modified to automatically insert unknown

stations into database and accept their requests.

#

CAUTION: setting this property to true is very dangerous, because we will accept EVERY BootNotification or WebSocket

connection attempt from ANY sender as long as the sender knows the URL and sends a valid message.

# auto.register.unknown.stations = false

DO NOT MODIFY

steve.version = ${project.version} git.describe = ${git.commit.id.describe} db.sql.logging = true profile = dev

rathourcode commented 1 year ago

i am able to acess steve but when i try to run mathews library i get the same error as you posted cpp/31/disconeected

jpily commented 1 year ago

Tell me the WS address and port number that will come out after Steve server starts

jpily commented 1 year ago

Tell me the local ip

  1. You must create a chargeBoxId on the Steve server.
  2. After making it, please let me know chargeBoxId and local ip. I'll fix the code that works accordingly and upload it
rathourcode commented 1 year ago

Tell me the local ip

  1. You must create a chargeBoxId on the Steve server.
  2. After making it, please let me know chargeBoxId and local ip. I'll fix the code that works accordingly and upload it

yes i i have created an id by name test1

jpily commented 1 year ago

\syslog-master\src\main\cisco\config\dev main.properties

Jetty HTTP settings

http.enabled = true Request to modify-> http.port = 8080

jpily commented 1 year ago

What is the internal ip? local ip is required

jpily commented 1 year ago

tell me the result. If it doesn't work, you'll have to move on

rathourcode commented 1 year ago

hai jpily i tried to run your code but it shows Replace cached operation

i removed all earlier cached data but it still gives me this error , can you help

rathourcode commented 1 year ago

were you able to acheive hearbeat using esp32 on steve ?

jpily commented 1 year ago

Can I have a look with a remote desktop connection?

jpily commented 1 year ago

If the development environment is Platformio, you can enable debugging mode to view the data transmission and reception process on the serial port

jpily commented 1 year ago

I'm at work.. There's no way I can help you if it's not this time

jpily commented 1 year ago

For your information, I tested both ESP32 and ESP32-S3 and checked the heartbeat

goekay commented 1 year ago

closing due to inactivity. i hope you resolved your issues after this exchange :)