Simhub freeze when ...
 
Notifications
Clear all

Simhub freeze when Arduino is connected

12 Posts
3 Users
1 Likes
2,658 Views
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

Hello,

I'm new is the forum so hello to everybody. I'm working on DIY mod of my F1 wheel addon. I added:

- LED strip WS2812 2X 8 LEDS

- 7 segments TM1637

- 2 buttons

- 5 encoders (not yet received)

- Arduino Nano clone

I have created my sketch in Simhub and uploaded it into the arduino.

Simhub is working fine but when i connect the arduino the application becomes unstable. It freezes when i try to open arduino setup page, or some command are not available in the ScreenEditor page as Ncalc Edit button.

I have uninstalled Simhub and reinstall it in a clean configuration (local App data folder deleted, installation folder deleted), same resultWith older Simhub version same problem.

Please find below my log:

[2020-05-09 09:27:49,776] INFO - Starting SimHub v7.0.2 (build time : 25/04/2020 11:39:57)
[2020-05-09 09:27:49,806] INFO - Administrator privileges : True
[2020-05-09 09:27:49,819] INFO - OS version : Microsoft Windows NT 10.0.18363.0, Windows 10.0.18363
[2020-05-09 09:27:49,819] INFO - License status : Licensed
[2020-05-09 09:27:49,819] INFO - Process priority : Normal
[2020-05-09 09:27:59,286] INFO - (Re)Starting ATS Game Manager and plugin manager
[2020-05-09 09:27:59,292] INFO - Creating American Truck Simulator game manager (ETS2Reader.ATSManager)
[2020-05-09 09:27:59,322] INFO - ATS game manager created
[2020-05-09 09:27:59,346] INFO - Checking configuration status for ATS
[2020-05-09 09:27:59,346] INFO - Configuration status for ATS: GameNotDetected
[2020-05-09 09:27:59,348] INFO - Creating plugin manager with plugins : SerialDashPlugin, AudioControlPlugin, JoystickPlugin, GraphicalDashPlugin, KeyboardEmulatorPlugin, NextionPlugin, ShakeITBSV3Plugin, ShakeITMotorsV3Plugin, LapHitoryPlugin, ThrustmastersPlugin
[2020-05-09 09:28:02,129] INFO - JoystickManager : Starting game controllers detection
[2020-05-09 09:28:02,152] INFO - JoystickManager : End of detection
[2020-05-09 09:28:02,304] INFO - Loading font list
[2020-05-09 09:28:02,768] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:28:02,808] INFO - Matrix custom font custommatrixfont8x8 loaded
[2020-05-09 09:28:03,097] ERROR - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at SimHub.Plugins.DataPlugins.ShakeItV3.ForceFeelAccess.GetDeviceSerialPort()
[2020-05-09 09:28:03,180] INFO - Web suggested IP :192.168.1.25
[2020-05-09 09:28:03,230] INFO - Web font-faces up to date
[2020-05-09 09:28:03,242] INFO - Loading plugins controls
[2020-05-09 09:28:03,873] INFO - Game successfully loaded
[2020-05-09 09:28:04,206] INFO - Font list loading successful
[2020-05-09 09:28:19,588] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:28:19,612] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:28:46,317] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:28:46,318] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:29:22,241] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:29:22,241] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:30:01,260] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:30:01,260] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:30:22,517] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:30:22,517] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:32:32,373] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:32:32,373] INFO - Starting Arduino in Single USB mode
[2020-05-09 09:32:47,296] ERROR - System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at SimHub.Plugins.DataPlugins.ShakeItV3.ForceFeelAccess.GetDeviceSerialPort()
[2020-05-09 09:32:51,565] INFO - Incoming debug message on COM8 : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! ? " ? ? # ? $ ? ? % ? & ? ? ' ? ( ? ) ? * ? + ? , ? - ? . ? ? / ? 0 ? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ? : ? ; ? < ? = ? > ? ? ? @ ? A ? B ? C ? D ? E ? F ? G ? H ? I ? J ? K ? ? L ? M ? N

[2020-05-09 09:32:57,181] INFO - Incoming debug message on COM8 : ! " # $ % & ' ( ) * ? + ? , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R ? S T ? U ? ? ? V W ? X Y ? Z ? [ \ ? ] ? ^ ? _ ? ` ? a b ? c ? d e ? f g h i j ? k ? l ? m ? n ? o ? S p ? T q ? r ? s U ? t V ? u ? v W ? w ? x X ? y ? z ? Y { ? Z | ? [ } ? ~ ? ?  ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  ? ~ ? ? } ? | ? ? ? { z ? y x ? w v ? u ? ? t ? s ? r ? ? ? ? ? q ? p ? o n m ? l k ? ? j ? i ? h ? g f ? e ? ? d ? c b ? a ? ` ? ? _ ? ^ ? ? ] \ [ Z ? Y ? X W ? V ? ? U ? T S ? R ? Q P ? O ? N M L K ? J ? I H ? ? G ? F ? E ? D ? C B ? A @ ? ? ? > = ? < ? ; ? : 9 8 ? 7 6 5 4 ? 3 2 ? 1 ? 0 ? / . ? - ? , + * ? ) ? ( ' ? & ? % ? $ # " ? ? ? ? ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

[2020-05-09 09:32:57,487] INFO - Found one device on COM8 named {
"ConnectedModel": "j",
"Features": "GNIJPX",
"TM1638ModulesCount": 0,
"SimpleModuleCount": 1,
"RGBLedsCount": 16,
"UniqueId": "1ac12c2a-1ec2-4940-aab0-dcf2b5af1bdc",
"AdditionalButtonsCount": 2,
"DeviceName": "F1 Wheel",
"PortName": "COM8",
"RotaryEncodersCount": 5,
"HasBoost": 0,
"HasSpeedo": 0,
"IsBluetooth": false,
"HasTacho": 0,
"HasI2CLcd": false,
"HasRGBMatrix": false,
"ExpandedFeatures": [
"encoders",
"mcutype",
"Gear"
],
"MaxAheadDatagrams": 0,
"DatagramMaxLength": 0,
"MCUModel": "ATmega328P",
"ReceivedDatagramsCount": 0
}
[2020-05-09 09:32:57,489] INFO - Switching device named F1 Wheel to speed level 11 on COM8
[2020-05-09 09:32:57,489] INFO - Switching device on port COM8 to speed level 11, 115200 bauds
[2020-05-09 09:32:57,747] INFO - Forcing arduino sync
[2020-05-09 09:32:58,002] INFO - Connected to device on COM8 named F1 Wheel
[2020-05-09 09:33:34,667] INFO - Hardware settings changed, restarting arduino controller(s)
[2020-05-09 09:35:05,424] INFO - Application exit
[2020-05-09 09:35:05,458] INFO - Stopping game manager
[2020-05-09 09:35:05,462] INFO - Stopping plugin manager
[2020-05-09 09:35:05,469] INFO - Saving plugin settings SimHub.Plugins.DataPlugins.DataCore.DataCorePlugin
[2020-05-09 09:35:05,470] INFO - SimHub.Plugins.DataPlugins.DataCore.DataCorePlugin plugin settings saved
[2020-05-09 09:35:05,470] INFO - Saving plugin settings SimHub.Plugins.DataPlugins.SystemInfosProvider
[2020-05-09 09:35:05,472] INFO - SimHub.Plugins.DataPlugins.SystemInfosProvider plugin settings saved
[2020-05-09 09:35:05,472] INFO - Saving plugin settings SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITBSV3Plugin
[2020-05-09 09:35:05,512] INFO - SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITBSV3Plugin plugin settings saved
[2020-05-09 09:35:05,512] INFO - Saving plugin settings SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITMotorsV3Plugin
[2020-05-09 09:35:05,519] INFO - SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITMotorsV3Plugin plugin settings saved
[2020-05-09 09:35:05,519] INFO - Saving plugin settings SimHub.Plugins.OutputPlugins.Nextion.NextionPlugin
[2020-05-09 09:35:05,540] INFO - SimHub.Plugins.OutputPlugins.Nextion.NextionPlugin plugin settings saved
[2020-05-09 09:35:05,540] INFO - Saving plugin settings SimHub.Plugins.OutputPlugins.GraphicalDash.GraphicalDashPlugin
[2020-05-09 09:35:05,549] INFO - SimHub.Plugins.OutputPlugins.GraphicalDash.GraphicalDashPlugin plugin settings saved
[2020-05-09 09:35:05,549] INFO - Saving plugin settings SimHub.Plugins.OutputPlugins.Dash.SerialDashPlugin
[2020-05-09 09:35:05,566] INFO - SimHub.Plugins.OutputPlugins.Dash.SerialDashPlugin plugin settings saved
[2020-05-09 09:35:05,567] INFO - Stopping plugin SimHub.Plugins.DataPlugins.DataCore.DataCorePlugin
[2020-05-09 09:35:05,567] INFO - Stopping plugin SimHub.Plugins.DataPlugins.SystemInfosProvider
[2020-05-09 09:35:05,568] INFO - Stopping plugin SimHub.Plugins.DataPlugins.PersistantTracker.PersistantTrackerPlugin
[2020-05-09 09:35:05,568] INFO - Stopping plugin SimHub.Plugins.AudioControl.AudioControlPlugin
[2020-05-09 09:35:05,579] INFO - Stopping plugin SimHub.Plugins.DataPlugins.Thrustmaster.ThrustmastersPlugin
[2020-05-09 09:35:05,581] INFO - Stopping plugin SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITBSV3Plugin
[2020-05-09 09:35:05,581] INFO - Finalizing plugin SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITBSV3Plugin
[2020-05-09 09:35:05,582] INFO - Stopping plugin SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITMotorsV3Plugin
[2020-05-09 09:35:05,582] INFO - Finalizing plugin SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITMotorsV3Plugin
[2020-05-09 09:35:05,582] INFO - Stopping plugin SimHub.Plugins.DataPlugins.PersistantTracker.LapHitoryPlugin
[2020-05-09 09:35:05,582] INFO - Stopping plugin SimHub.Plugins.DataPlugins.Shell.ShellPlugin
[2020-05-09 09:35:05,582] INFO - Finalizing plugin SimHub.Plugins.DataPlugins.Shell.ShellPlugin
[2020-05-09 09:35:05,582] INFO - Stopping plugin SimHub.Plugins.InputPlugins.JoystickPlugin
[2020-05-09 09:35:05,583] INFO - Stopping plugin SimHub.Plugins.KeyboardEmulator.KeyboardEmulatorPlugin
[2020-05-09 09:35:05,583] INFO - Stopping plugin SimHub.Plugins.OutputPlugins.Nextion.NextionPlugin
[2020-05-09 09:35:05,593] INFO - Stopping plugin SimHub.Plugins.OutputPlugins.GraphicalDash.GraphicalDashPlugin
[2020-05-09 09:35:05,594] INFO - Finalizing plugin SimHub.Plugins.OutputPlugins.GraphicalDash.GraphicalDashPlugin
[2020-05-09 09:35:05,595] INFO - Stopping plugin SimHub.Plugins.OutputPlugins.Dash.SerialDashPlugin
[2020-05-09 09:35:05,596] INFO - Stopping plugin SimHub.Plugins.Web.WebPlugin
[2020-05-09 09:35:05,597] INFO - Finalizing plugin SimHub.Plugins.Web.WebPlugin
[2020-05-09 09:35:05,597] INFO - Stopped all plugins
[2020-05-09 09:35:05,597] INFO - Performance dump
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.DataPlugins.PersistantTracker.PersistantTrackerPlugin::DataUpdate 25152calls 84ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.OutputPlugins.Dash.SerialDashPlugin::DataUpdate 25152calls 398ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.OutputPlugins.GraphicalDash.GraphicalDashPlugin::DataUpdate 25152calls 1482ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.DataPlugins.DataCore.DataCorePlugin::DataUpdate 25152calls 168ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.Web.WebPlugin::DataUpdate 25152calls 105ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - MultipleSerialDashPlugin::WorkerLoop 7974calls 570ms 7974calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.AudioControl.AudioControlPlugin::DataUpdate 25152calls 215ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - SimHub.Plugins.DataPlugins.SystemInfosProvider::DataUpdate 25152calls 5ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,597] INFO - JoystickPlugin::PollThread 20335calls 8ms 20335calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - SimHub.Plugins.DataPlugins.PersistantTracker.LapHitoryPlugin::DataUpdate 25152calls 0ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITBSV3Plugin::DataUpdate 25152calls 91ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - SimHub.Plugins.DataPlugins.ShakeItV3.ShakeITMotorsV3Plugin::DataUpdate 25152calls 55ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - JoystickManager::DetectJoysticks 2calls 78ms 2calls 39.000ms/call
[2020-05-09 09:35:05,598] INFO - SimHub.Plugins.OutputPlugins.Nextion.NextionPlugin::DataUpdate 25152calls 0ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - SimHub.Plugins.DataPlugins.Thrustmaster.ThrustmastersPlugin::DataUpdate 25152calls 1ms 25152calls 0.000ms/call
[2020-05-09 09:35:05,598] INFO - Final Exit

Best regards,

 

 

 


   
Quote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 727
 

Hi ! At first sight, it looks like some crap coming from the serial port, It makes think about bad code in custom protocol but you said it was reset so it's not likely to be the case, but worth checking if you played into this. 

I would also think about some components sets to pin 0 or 1 or a physical short with TX pin.

NB nano is far from the best choice for buttons and encoders 😉 you won't have gamepad features :  https://github.com/SHWotever/SimHub/wiki/Arduino--Setup#recommended-arduinos


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

Thank you very much wotever for your fast answer.

Concerning my Arduino choice, i haven't no other choice because i need a small factor controller to enter in my wheel keeping the original Thrustmaster PCB installed. 

I have tried several USB ports on my computer and also changed the USB cable connected to the Arduino.

Concerning encoders and switches i would managed them using the controls and events window by mapping an encoder command to a keyboard key.

Is not possible?

BR


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

Wotever,

I have another question.

Why Simhub doesn't support Arduino Leonardo?

BR 


   
ReplyQuote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 727
 

@did-13003

When I built it leonardo clones where still pretty expensive, so I kept focused on cheap versions of all boards (that's also why I won't support teensy). Leonoardo clones are much cheaper now so I will probably add it soon. In all cases, if you use "pro micro" in the setup tool, it will work with Leonardo (it's the same, only the form factor varies)


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

@admin5435

I have also promicro clone but i need more digital inputs (18) in my project. 

Concerning my freeze problem i have identified the issue but maybe you can explain me.

I have removed from my sketch the 5 encoders (because i haven't yet received them) then i have reloaded the sketch and now Simhub is stable.

Do you know the explanation?


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  
Posted by: @admin5435

@did-13003

When I built it leonardo clones where still pretty expensive, so I kept focused on cheap versions of all boards (that's also why I won't support teensy). Leonoardo clones are much cheaper now so I will probably add it soon. In all cases, if you use "pro micro" in the setup tool, it will work with Leonardo (it's the same, only the form factor varies)

I checked in Arduino setup tool, the Micro pinout displayed is not corresponding to Arduino Micro offcial pinout but i can affect digital outputs (11 to 13) not shown on the picture. Can you confirm that it's just a bug of the S/W? because i considering to buy a true Arduino Micro to replace my Nano clone following your advice.

BR


   
ReplyQuote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 727
 

@did-13003

"Arduino micro" and "arduino pro micro" are two different boards, I only support and tested the "pro micro" version, but if I'm not wrong just like the Leonardo vs pro micro those boards are identical when it comes to configuration and upload, it's just a different form factor.

About freeze it's probably due to the floating pins triggering random inputs flooding the serial port.


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

@admin5435

Thank you for your reply so migrate to Arduino Pro Micro is not possible because Pro Micro hasn't enough digital output.

Can i emulate keyboard with my encoders and switches in Simhub? 


   
ReplyQuote
(@did-13003)
Active Member
Joined: 4 years ago
Posts: 8
Topic starter  

Tout marche nickel. J ai mappé mes encodeurs avec des touches du clavier ça marche nickel.

Le seul petit problème c'est qu'il faut plusieurs click pour que la commande passe. Je dirai 4 ou 5.

Peut-on réduire ça style un click une commande?

A+


   
ReplyQuote
(@sparky159)
New Member
Joined: 3 years ago
Posts: 2
 

@admin5435
Not sure what you meant, what is the reason you won't support Teensy? Cost? The Teensy LC is US$11.65 on their website and it's ARM processor outperforms ATMEGA in pretty much every way. Teensy 4.0 is a steal at US$20 IMHO.
I stumbled on this thread while trying to get a Teensy 4.0 to work with SimHub so I am curious... 


   
ReplyQuote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 727
 

@sparky159

Actually 2,3 reasons i stick to the regular Arduino

- cost , this argument is slowly becoming wrong, prices are dropping, five years ago when I started prices where totally different, that said teensy LC is 4 times more expensive than a pro micro (about 2$~) when being patient and sourced from China, but having more power does not means you need more power, except extreme setups, regular Arduino do the work without issues.

- 3.3v logic, most Arduino peripherals are designed for 5v logic, some of them may work but it's playing with the limits

- maintainability, I decided to limit the scope of Simhub to classic Arduino, more boards means more potential issues, more testing work, I'm alone behind the scene, and I have to stay reasonable on the feature scope, that's the same reason why I don't plan flight Sims at short term. 

 

 

 

 


   
sparky159 reacted
ReplyQuote
Share: