Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.5K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

Code won't run within init.m

POSTED BY: Ken Levasseur
4 Replies

Thanks Ilian, it hadn't occurred to me that the serial connection wasn't initialized. I simply put my code into a package and I delayed running it a minute within a ScheduledTask. It worked!

POSTED BY: Ken Levasseur

Not all functionality is completely initialized and available to use during the early stages of kernel startup.

Try using the following in init.m instead:

task := (...);  (* code to be executed *)
RunScheduledTask[task, {1}]
POSTED BY: Ilian Gachevski

David:

Yes, the value of $AddOnsDirectory in the Raspberry Pi version of Mathematica is

/usr/share/WolframEngine/Kernel

The init file evaluates, but for some reason, the Serial connection doesn't get established when I try to do it as part of init.m.

POSTED BY: Ken Levasseur

Is this the same directory as

FileNameJoin[{$UserBaseDirectory, "Kernel"}]

(I actually have no idea about Raspberry Pi s, etc... just offering the location where I put revised init.m things on my laptop Mathematica.)

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard