Freematics Hub for Linux is released

Discussion about software developed by Freematics, including Freematics Builder and Freematics Emulator GUI
Post Reply
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

Freematics Hub for Linux is released

Post by stanley »

Binary for Ubuntu Linux x64 can be downloaded from https://freematics.com/hub
cryptographrix
Posts: 4
Joined: Wed Apr 12, 2017 11:20 am

Re: Freematics Hub for Linux is released

Post by cryptographrix »

Is it possible to make a public Docker image of this?
HonkMcFunk
Posts: 3
Joined: Sat Mar 10, 2018 12:51 am

Re: Freematics Hub for Linux is released

Post by HonkMcFunk »

Hey guys,

thanks for this release. I'm trying to run the 32bit version on a raspberry pi 3 with Ubuntu Mate. (Also tried the 64bit version, but the OS is 32bit)
When i try to start by double clicking the "freematicshub" file (which it shows as an executable) nothing happens.

When I try running the the run.sh in the terminal like in the instruction:
$ sudo sh run.sh

i get an error like:

./electron/electron: 1: ./electron/electron: ELFΉ4
�=4: not found
./electron/electron: 4: ./electron/electron: Syntax error: word unexpected (expecting ")")
./freematicshub: 1: ./freematicshub: Syntax error: word unexpected (expecting ")")


Any ideas?
Thank you in advance!
aboaboit
Posts: 23
Joined: Mon Mar 26, 2018 4:55 am

Re: Freematics Hub for Linux is released

Post by aboaboit »

I'm also interested in a Raspi version
HonkMcFunk
Posts: 3
Joined: Sat Mar 10, 2018 12:51 am

Re: Freematics Hub for Linux is released

Post by HonkMcFunk »

Ok, I asked some "smart people" and they explained to me, that although the RasPi is running "Ubuntu" it's not the same (as the underlying architecture is completely different) and so the code for the "standard" Ubuntu won't be able to run.

(Silly me thought, that the OS will "abstract away" those architectural diferences :oops: )
ashamim
Posts: 2
Joined: Thu Sep 06, 2018 9:43 pm

Re: Freematics Hub for Linux is released

Post by ashamim »

Considering freematics HUB is open sourced under GPL license, is it possible to access the code for HUB somewhere ?
jfl
Posts: 3
Joined: Mon Jan 04, 2021 2:30 am

Re: Freematics Hub for Linux is released

Post by jfl »

Happy New Year everyone,
I attempted to install FreematicsHub on my Ubuntu server, but was unsuccessful. Please help direct me to a resource to get me on track to setup the FreematicsHub on Ubuntu so that I can start using telelogger.

I downloaded and extracted the .zip file with the Freematics repository from GitHub. I did not find a .tar file for Ubuntu mentioned in the installation guide.

I attempted to follow the instructions for Linux https://blog.freematics.com/2018/freema ... ck-system/, but was unable to run or compile teleserver.c. I'm not experienced with compiling from source code, so this is likely a user error. I read the g++ --help, but please direct me to what I'm missing.
From the teleserver folder I used:

Code: Select all

g++ -o teleserver -I httpd -l httpd teleserver.c
It returned the following issues:

Code: Select all

teleserver.c: In function ‘void initChannel(CHANNEL_DATA*, int)’:
teleserver.c:188:21: error: invalid conversion from ‘void*’ to ‘CACHE_DATA*’ [-fpermissive]
  188 |  pld->cache = calloc(cacheSize, sizeof(CACHE_DATA));
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     void*
teleserver.c: In function ‘int uhChannels(UrlHandlerParam*)’:
teleserver.c:665:106: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
  665 | "id\":\"%u\",\"devid\":\"%s\",\"recv\":%u,\"rate\":%u,\"tick\":%llu,\"devtick\":%u,\"elapsed\":%u,\"age\":{\"data\":%u,\"ping\":%u},\"rssi\":%d,\"flags\":%u,\"parked\":%u",
      |                                                                ~~~^
      |                                                                   |
      |                                                                   long long unsigned int
      |                                                                %lu
  666 | ved, (unsigned int)pld->sampleRate, pld->serverDataTick, pld->deviceTick, pld->elapsedTime,
      |                                     ~~~~~~~~~~~~~~~~~~~            
      |                                          |
      |                                          uint64_t {aka long unsigned int}

teleserver.c: In function ‘int uhGet(UrlHandlerParam*)’:
teleserver.c:808:58: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
  808 |  l += snprintf(buf + l, bs - l, "{\"stats\":{\"tick\":%llu,\"devtick\":%u,\"elapsed\":%u,\"age\":{\"data\":%u,\"ping\":%u},\"rssi\":%d,\"flags\":%u,\"parked\":%u}",
      |                                                       ~~~^
      |                                                          |
      |                                                          long long unsigned int
      |                                                       %lu
  809 |   pld->serverDataTick, pld->deviceTick, pld->elapsedTime,
      |   ~~~~~~~~~~~~~~~~~~~                                     
      |        |
      |        uint64_t {aka long unsigned int}
teleserver.c: In function ‘int uhPull(UrlHandlerParam*)’:
teleserver.c:854:98: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 6 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
  854 |  bufsize - bytes, "\"stats\":{\"recv\":%u,\"rate\":%u,\"tick\":%llu,\"devtick\":%u,\"elapsed\":%u,\"age\":{\"data\":%u,\"ping\":%u},\"parked\":%u}",
      |                                                                ~~~^
      |                                                                   |
      |                                                                   long long unsigned int
      |                                                                %lu
  855 | int)pld->sampleRate, pld->serverDataTick, pld->deviceTick, pld->elapsedTime, age, pingage, (pld->flags & FLAG_RUNNING) ? 0 : 1);
      |                      ~~~~~~~~~~~~~~~~~~~                           
      |                           |
      |                           uint64_t {aka long unsigned int}

teleserver.c: In function ‘int uhCommand(UrlHandlerParam*)’:
teleserver.c:946:31: error: invalid conversion from ‘void*’ to ‘HttpParam*’ {aka ‘_httpParam*’} [-fpermissive]
  946 |   token = issueCommand(param->hp, pld, cmd, token);
      |                        ~~~~~~~^~
      |                               |
      |                               void*
In file included from teleserver.c:25:
teleserver.h:129:34: note:   initializing argument 1 of ‘uint32_t issueCommand(HttpParam*, CHANNEL_DATA*, const char*, uint32_t)’
  129 | uint32_t issueCommand(HttpParam* hp, CHANNEL_DATA *pld, const char* cmd, uint32_t token);
      |                       ~~~~~~~~~~~^~
teleserver.c: In function ‘char* GetLocalAddrString()’:
teleserver.c:1104:22: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 1104 |  if (!lpHost) return "127.0.0.1";
      |                      ^~~~~~~~~~~
teleserver.c: In function ‘int main(int, char**)’:
teleserver.c:1141:17: error: invalid conversion from ‘void*’ to ‘__sighandler_t’ {aka ‘void (*)(int)’} [-fpermissive]
 1141 |  signal(SIGINT, (void *) ServerQuit);
      |                 ^~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
In file included from httpd/httppil.h:50,
                 from httpd/httpd.h:13,
                 from teleserver.c:24:
/usr/include/signal.h:88:57: note:   initializing argument 2 of ‘void (* signal(int, __sighandler_t))(int)’
   88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler)
      |                                          ~~~~~~~~~~~~~~~^~~~~~~~~
teleserver.c:1142:18: error: invalid conversion from ‘void*’ to ‘__sighandler_t’ {aka ‘void (*)(int)’} [-fpermissive]
 1142 |  signal(SIGTERM, (void *) ServerQuit);
      |                  ^~~~~~~~~~~~~~~~~~~
      |                  |
      |                  void*
In file included from httpd/httppil.h:50,
                 from httpd/httpd.h:13,
                 from teleserver.c:24:
/usr/include/signal.h:88:57: note:   initializing argument 2 of ‘void (* signal(int, __sighandler_t))(int)’
   88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler)
      |                                          ~~~~~~~~~~~~~~~^~~~~~~~~
teleserver.c:1148:29: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 1148 |  GetFullPath(path, argv[0], "htdocs");
      |                             ^~~~~~~~
teleserver.c: In function ‘FILE* getLogFile()’:
teleserver.c:240:33: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 128 [-Wformat-truncation=]
  240 |   snprintf(path, sizeof(path), "%s/%u.txt", logDir, date);
      |                                 ^~          ~~~~~~
teleserver.c:240:11: note: ‘snprintf’ output between 7 and 271 bytes into a destination of size 128
  240 |   snprintf(path, sizeof(path), "%s/%u.txt", logDir, date);
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
teleserver.c: In function ‘void SaveChannels()’:
teleserver.c:440:34: warning: ‘/channels.dat’ directive output may be truncated writing 13 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
  440 |  snprintf(path, sizeof(path), "%s/channels.dat", dataDir);
      |                                  ^~~~~~~~~~~~~
teleserver.c:440:10: note: ‘snprintf’ output between 14 and 269 bytes into a destination of size 256
  440 |  snprintf(path, sizeof(path), "%s/channels.dat", dataDir);
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
teleserver.c: In function ‘int LoadChannels()’:
teleserver.c:456:34: warning: ‘/channels.dat’ directive output may be truncated writing 13 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
  456 |  snprintf(path, sizeof(path), "%s/channels.dat", dataDir);
      |                                  ^~~~~~~~~~~~~
teleserver.c:456:10: note: ‘snprintf’ output between 14 and 269 bytes into a destination of size 256
  456 |  snprintf(path, sizeof(path), "%s/channels.dat", dataDir);
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I also attempted to follow the screenshot listed under the "On Linux, please build from source code..." https://freematics.com/hub/. Using "sudo sh run.sh" returned the error: "sh: 0: Can't open run.sh" as the file run.sh does not exist in the teleserver folder.

Please let me know where I should turn to get the teleserver up and running. If you need any additional information to point me in the right direction, just let me know.

Thank you,
Jonathan
jfl
Posts: 3
Joined: Mon Jan 04, 2021 2:30 am

Re: Freematics Hub for Linux is released

Post by jfl »

For anyone that is unfamiliar with compiling from source code and wants to install FreematicsHub for vehicle data logging:
1) Download FreematicsHub from the GitHub repository: https://github.com/stanleyhuangyc/Freematics

2) Extract the .zip file and "cd" into the teleserver folder

Code: Select all

cd teleserver
3) Build teleserver from the source code https://www.howtogeek.com/105413/how-to ... on-ubuntu/
was helpful.
It is very simple to compile FreematicsHub, from the teleserver folder.

Code: Select all

make

Code: Select all

sudo make install
That's all there was too it.

4) Continue with the instructions from Stanley: https://blog.freematics.com/2018/freema ... ck-system/

Code: Select all

./teleserver
Hopefully that saves someone from spending the six hours it took me to figure out how easy it is. :)
Post Reply