Git Product home page Git Product logo

trainsimulator-controller's Introduction

Build Status Codacy Badge

TrainSimulator Controller

This project was created to use custom controls as input or output while playing TrainSimulator. Especially when activating Sifa and PZB direct interaction is needed as soon as this is indicated by the game. But not in all situations (e.g. camera position) the regarding controls are visible. So the idea was, having custom controls outside of the game.

TrainSimulator offers an API to interact with the game and get status of any control provided by the driven locomotive. It is also possible to send control changes to the game, e.g. indicating that PZB vigilance has been pressed. So you can use this API to communicate with custom input/output controls.

Project structure

The API provided by TrainSimulator is available by a Windows DLL only and thus can be accessed on the host only. To be able to access the API also from other clients (e.g. a Raspberry PI or Arduino) a service had to be established. The current project offers a server part with this logic, a client part accessing this service and two sample clients using a Raspberry PI and a FT232h controller.

module description
trainsimulator-client Client component which can access the REST service provided by trainsimulator-server.
trainsimulator-core Domain classed used by client and server modules.
trainsimulator-ft232h Sample client for a FT232h controller used as USB device on the host.
trainsimulator-parent Infrastructure module managing dependencies.
trainsimulator-raspberry Sample client for Raspberry using the service over LAN/WLAN.
trainsimulator-server Server component providing REST service on host.

trainsimulator-server

The server module provides a REST service with all functions to interact with TrainSimulator API. It's a Spring Boot application which can be started as fat jar. By default the service will be started on port 13913. The REST service provides the following methods:

method path description
GET /trainsimulator/locomotive Information about the current engine with their supported controls.
GET /trainsimulator/generic Information about the current engine in plain format.
GET /trainsimulator/control/{control} Get value of single control with min, max and current.
PUT /trainsimulator/control/{control} Change value of a single control.

Using the REST service is one way to interact with TrainSimulator API. Another way is to extend the trainsimulator-server application. For handling changes of a control's value an annotated method can be used. Just declare a spring component with a method with io.mathan.trainsimulator.service.Present annotation. This methods accepts a parameter of type io.mathan.trainsimulator.service.Event and is called each time a control's value changes. (The check is scheduled each 100ms)

@Present
public void present(Event event) {
  Control control = event.getControl();
  ControlData data = event.getData();
}

By this you can manage output controls. To manage input controls you have to send events to a trainsimulator-server component. This can be done by having a spring component with the io.mathan.trainsimulator.service.Collector component injected. If an input control should fire an event the method Collector.raiseEvent(Event) should be used.

@Component
public class CustomInputControl {
  private Collector collector;
  public void someMethod() {
    ...
    Control control;
    ControlData data;
    Event event = new Event(control, data);
    collector.raiseEvent(event);
  }
}

The REST service itself is using both approaches to publish control changes received through the REST call to TrainSimulator and acts as receiver of control changes. These are cached for the REST calls.

Supported controls

There are various controls supported by TrainSimulator. It depends on the selected engine which controls are available. There are also differences in naming of the controls. For a generic API an defined enum is used to identify the controls. In general the API can be used to either display the current/minimum/maximum value of a control and to change the value of a control, e.g. for resetting the VigilAlarm or change the throttle.

The following controls are supported (although there are different names for the controls in different engines, the names chosen are the common used):

  • Vigil controls
    • VigilEnable
    • VigilLight
    • VigilAlarm
    • VigilReset
  • PZB controls
    • PZBEnable
    • PZB_55
    • PZB_70
    • PZB_85
    • PZB_40
    • PZB_500
    • PZB_1000
    • PzbWarning
    • Cmd_40
    • Cmd_Free
    • Cmd_Wachsam

Support for additional locomotives

The controls above are some of the major controls when using vigil or PZB. The name of the control in TrainSimulator depends on the vendor of the product. It is not the same for all locomotives. Therefore mappings can be defined if the name of the control does not match the control name above. There are already some default mappings for some of the locomotives I used.

Please see default.mapping for details.

Sample trainsimulator-ft232h (second version)

The description of the first version using ft232h can be found in the next chapter. After that I created a second version with more functionality. It is using a Adafruit FT232h breakout as USB decive too. But this time more devices are connected using I2C protocol. I used:

With this sample project I can show all pzb controls, sifa light the LZB distance (<1000m red, <4000m yellow, >4000m green) and numbers/time on the three 4 digit displays. Currently I implemented:

  • showing time (scenario time)
  • showing LZB distance in meters
  • showing LZB speed (Vsoll which is maximum speed allowed in current section, Vziel which is maximum speed allowed in next section)
  • showing AFB target speed
  • showing current speed

Sample trainsimulator-ft232h (first version)

This sample project adds a Adafruit FT232h breakout as USB devices to the host and sends the control data using GPIO. Therefore trainsimulator-ft232h extends the Spring Boot application of trainsimulator-server by registering an additional component to receive events that sent to the FT232h.

To be able to connect controls (the sample supports output controls only) you have to provide a configuration file application.properties in the same folder as the JAR of the spring boot application. In this file the mapping is made between the control and the GPIO pin to use. By default the file looks like this:

# needed to activate spring component to connect to ft232h
spring.profiles.active=production,pzb
# important for additional clients or when accessing REST service through browser
server.port=13913
pzb.pzb55=C0
pzb.pzb70=C1
pzb.pzb85=C2
pzb.pzb40=C3
pzb.pzb500=C4
pzb.pzb1000=C5
pzb.sifaLight=D1
pzb.sifaWarn=C6

This sample supports the following properties:

  • pzb.pzb55
  • pzb.pzb70
  • pzb.pzb85
  • pzb.pzb40
  • pzb.pzb500
  • pzb.pzb1000
  • pzb.sifaLight
  • pzb.sifaWarn

As values you can use C0-C7 and D0-D7.

Requirements:

trainsimulator-controller's People

Contributors

dependabot[bot] avatar reallyinsane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vassilydev

trainsimulator-controller's Issues

Cant connect to Host from Raspberry Pi 4

I have installed java on the Raspberry Pi and it works.

I compiled the prject with OpenJDK11 and the java version on the Pi is the same.
I tried to run the "trainsimulator-rasperry-1.1.0.jar" i get the following Output:

:: Spring Boot :: (v2.2.2.RELEASE)

2021-10-29 22:43:47.949 INFO 4973 --- [ main] i.m.t.raspberry.RaspberryApplication : Starting RaspberryApplication v1.1.0 on raspberrypi with PID 4973 (/home/pi/java/trainsimulator-raspberry-1.1.0.jar started by pi in /home/pi/java)
2021-10-29 22:43:47.959 INFO 4973 --- [ main] i.m.t.raspberry.RaspberryApplication : The following profiles are active: client
2021-10-29 22:43:51.334 INFO 4973 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'trainsimulatorConfiguration' of type [io.mathan.trainsimulator.client.TrainsimulatorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-29 22:43:54.831 WARN 4973 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'service' defined in URL [jar:file:/home/pi/java/trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/lib/trainsimulator-core-1.1.0.jar!/io/mathan/trainsimulator/service/Service.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restConnector' defined in URL [jar:file:/home/pi/java/trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/lib/trainsimulator-client-1.1.0.jar!/io/mathan/trainsimulator/client/RestConnector.class]: Invocation of init method failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://DESKTOP-T3Q6VU0:8000/trainsimulator/generic": Keine Route zum Zielrechner (Host unreachable); nested exception is java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
2021-10-29 22:43:54.932 INFO 4973 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-29 22:43:54.952 ERROR 4973 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'service' defined in URL [jar:file:/home/pi/java/trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/lib/trainsimulator-core-1.1.0.jar!/io/mathan/trainsimulator/service/Service.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restConnector' defined in URL [jar:file:/home/pi/java/trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/lib/trainsimulator-client-1.1.0.jar!/io/mathan/trainsimulator/client/RestConnector.class]: Invocation of init method failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://DESKTOP-T3Q6VU0:8000/trainsimulator/generic": Keine Route zum Zielrechner (Host unreachable); nested exception is java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:240) ~[spring-context-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:722) ~[spring-context-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) ~[spring-context-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at io.mathan.trainsimulator.raspberry.RaspberryApplication.main(RaspberryApplication.java:28) ~[classes!/:1.1.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restConnector' defined in URL [jar:file:/home/pi/java/trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/lib/trainsimulator-client-1.1.0.jar!/io/mathan/trainsimulator/client/RestConnector.class]: Invocation of init method failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://DESKTOP-T3Q6VU0:8000/trainsimulator/generic": Keine Route zum Zielrechner (Host unreachable); nested exception is java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:885) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
... 27 common frames omitted
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://DESKTOP-T3Q6VU0:8000/trainsimulator/generic": Keine Route zum Zielrechner (Host unreachable); nested exception is java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:751) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:677) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:345) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at io.mathan.trainsimulator.client.RestConnector.getGenericLocomotive(RestConnector.java:69) ~[trainsimulator-client-1.1.0.jar!/:1.1.0]
at io.mathan.trainsimulator.client.RestConnector.afterPropertiesSet(RestConnector.java:78) ~[trainsimulator-client-1.1.0.jar!/:1.1.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
... 38 common frames omitted
Caused by: java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:558) ~[na:na]
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[na:na]
at java.base/sun.net.www.http.HttpClient.(HttpClient.java:242) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) ~[na:na]
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:742) ~[spring-web-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
... 44 common frames omitted
``

I have no idea.
I had to change the trainsimulator.hos Variable in the application.properties for the Pi. Alsow i changed the Port to 8000 in both Pi and Server.

I think the problem lies about:
I/O error on GET request for "http://DESKTOP-T3Q6VU0:8000/trainsimulator/generic": Keine Route zum Zielrechner (Host unreachable); nested exception is java.net.NoRouteToHostException: Keine Route zum Zielrechner (Host unreachable)

Throttle control

Is it possible to control the regulator and brakes of the train? If yes, how?
Thanks.

Help

Hello, can you tell in a simplified way what needs to be done so that the indication and readings from the game go to the indication of the connected board? What files need to be added to the game, and what firmware should be inserted into the board?

Raspberry PI GPIO Mapping

Hey
Maybe this is a stupide question. But where can i specify the GPIO mapping for the Pi?
I found the mapping for the different locos and in the ft232h the GPIO mapping is, as I understand in the applications.properties file.
But for the Pi I don't realy get it.

sorry i was just stupid.

.jar crashes when i drive the RhB ABe 8-12 Allegra BEX EWB

I tried to test the SIFA. I opend TS 2022, started the Trainsimulator-server and started the trainsimulator-raspberry-1.1.0.jar.
When I started a quick session with teh RhB ABe 8-12 Allegra the Raspberry put out this:
2021-11-03 21:15:38.085 INFO 851 --- [ main] i.m.trainsimulator.raspb erry.GpioClient : loco changed to RhB ABe 8-12 Allegra BEX EWB

And afterwards crashed aso shown:

`2021-11-03 21:15:38.142 ERROR 851 --- [ main] com.pi4j.util.NativeLibr aryLoader : Unable to load [libpi4j.so] using path: [/lib/raspberrypi/dyn amic/libpi4j.so]

java.lang.UnsatisfiedLinkError: /tmp/libpi4j11962884997730594727.so: libwiringPi .so: Kann die Shared-Object-Datei nicht ▒ffnen: Datei oder Verzeichnis nicht gef unden
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) ~[ na:na]
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2 442) ~[na:na]
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader .java:2498) ~[na:na]
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694) ~ [na:na]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627) ~[ na:na]
at java.base/java.lang.Runtime.load0(Runtime.java:768) ~[na:na]
at java.base/java.lang.System.load(System.java:1837) ~[na:na]
at com.pi4j.util.NativeLibraryLoader.loadLibraryFromClasspath(NativeLibr aryLoader.java:159) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:105) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.wiringpi.Gpio.(Gpio.java:189) ~[pi4j-core-1.2.jar!/: na]
at com.pi4j.io.gpio.RaspiGpioProvider.(RaspiGpioProvider.java:69) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.io.gpio.RaspiGpioProvider.(RaspiGpioProvider.java:51) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.platform.Platform.getGpioProvider(Platform.java:125) ~[pi4j- core-1.2.jar!/:na]
at com.pi4j.platform.Platform.getGpioProvider(Platform.java:118) ~[pi4j- core-1.2.jar!/:na]
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.io.gpio.impl.GpioControllerImpl.(GpioControllerImpl.ja va:53) ~[pi4j-core-1.2.jar!/:na]
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91) ~[pi4j- core-1.2.jar!/:na]
at io.mathan.trainsimulator.raspberry.GpioClient.initGpio(GpioClient.jav a:151) ~[classes!/:1.1.0]
at io.mathan.trainsimulator.raspberry.GpioClient.updateLoco(GpioClient.j ava:103) ~[classes!/:1.1.0]
at io.mathan.trainsimulator.raspberry.GpioClient.afterPropertiesSet(Gpio Client.java:109) ~[classes!/:1.1.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring -beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-be ans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans -5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5 .2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$ doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2 .2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.2.RELEA SE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe an(AbstractBeanFactory.java:321) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEAS E]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:202) ~[spring-beans-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory. preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2 .2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finish BeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context- 5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refres h(AbstractApplicationContext.java:550) ~[spring-context-5.2.2.RELEASE.jar!/:5.2. 2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicat ionContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2. 2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication. java:747) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringAppli cation.java:397) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java :315) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java :1226) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java :1215) ~[spring-boot-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at io.mathan.trainsimulator.raspberry.RaspberryApplication.main(Raspberr yApplication.java:28) ~[classes!/:1.1.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner .java:48) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[t rainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[t rainsimulator-raspberry-1.1.0.jar:1.1.0]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[trainsimulator-raspberry-1.1.0.jar:1.1.0]

2021-11-03 21:15:38.147 WARN 851 --- [ main] ConfigServletWebServerAp plicationContext : Exception encountered during context initialization - cancell ing refresh attempt: org.springframework.beans.factory.BeanCreationException: Er ror creating bean with name 'gpioClient' defined in URL [jar:file:/home/pi/java/ trainsimulator-raspberry-1.1.0.jar!/BOOT-INF/classes!/io/mathan/trainsimulator/r aspberry/GpioClient.class]: Invocation of init method failed; nested exception i s java.lang.UnsatisfiedLinkError: 'int com.pi4j.wiringpi.Gpio.wiringPiSetup()'
2021-11-03 21:15:38.158 INFO 851 --- [ main] o.apache.catalina.core.S tandardService : Stopping service [Tomcat]
2021-11-03 21:15:38.215 INFO 851 --- [ main] ConditionEvaluationRepor tLoggingListener :
`

I think it is a Mapping problem as the RhB ABe 8-12 Alegra is not included in the default.mapping.
If it is that, what do i have to wirte in to the default.mappgin and where do i finde the needed Info for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.