Raspberry PI Emoncms - Starting from scratch, Which method

Hi All

 

Had my TX running since purchase last year, at the time i set up the Raspberry PI following some instructions that enabled a boot image to the SD card and a HDD stack image for running form a hard drive instead of the SD, I used a 8GB usn stick in place of a Hard drive but worked fine.

A short time ago the PI got borrowed for something else  and now needs to go back to collecting data from the TX, i want to set it up with the latest / best option,

The thread with the details of using the HDD stack seems to be missing so i assume this is not the best way forward now?

I down loaded the image linked to from here

Latest - emonSD-13-03-15.img.zip (1.3GB)

https://github.com/emoncms/emoncms/blob/bufferedwrite/docs/setup.md

 

Followed instructions, image on SD card and connected to the PI without the hard drive, i can log in with putty but when i run the command 

$ localemoncms-enable
 

It results in a fail when starting the MySQL server

 

Is there a minimum version PI required for this image? is there still an option for using a seperate hard drive? anyone know why MySQL isnt starting?

 

Thanks

pb66's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

Is there a minimum version PI required for this image? is there still an option for using a seperate hard drive? anyone know why MySQL isnt starting?

I'm unaware of any minimum requirement issues it should certainly run on a Pi B, B+ or 2B. I haven't tried an A but if it ran ok previously, there hasn't been any great change to prevent the same hardware working.

You can still use a hdd, that image was specifically aimed at SD card use and is optimized for that and less so for a hdd install, but it will work on a hdd, however IMO you are better building a full install from scratch using the linux guide as a rough guide but I also appreciate that isn't the easiest of route's.

I've not come across anyone having a "mySQL not starting issue" with the pre-built image, can you give more detail? error codes etc

Paul

Keith Drayton's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

There isnt realy an error that i can see, just a fail starting the MySQL

 

Heres a screen shot of the putty window

 

https://www.dropbox.com/s/1inlrqqn1srgh4m/MySQL%20Fail.PNG?dl=0

pb66's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

No I can't say I've seen that, are there any log entries? the log files should be somewhere like /var/log/mysql/error.log or something similar. If you are using the read only image the logs are kept in ram so lost at reboot so you may need to cause a fail so see a logged message if you have rebooted recently.

Paul

Keith Drayton's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

Here is the contents of the syslog from boot until SQL fails to start, some erros in there but unfortunatly not much use to me.

Does the problem start as early as line 3 or is that normal? (FAT-fs) i cant run fsck, get errors,

Need to find another card to try

pi@emonbase /var/log $ nano syslog
  GNU nano 2.2.6                                            File: syslog

Apr 17 15:03:54 emonbase kernel: [    9.635581] random: nonblocking pool is initialized
Apr 17 15:03:54 emonbase kernel: [    9.728521] i2c /dev entries driver
Apr 17 15:03:54 emonbase kernel: [   15.073068] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Apr 17 15:03:54 emonbase kernel: [   15.078786] EXT4-fs (mmcblk0p3): mounting ext2 file system using the ext4 subsystem
Apr 17 15:03:54 emonbase kernel: [   15.092602] EXT4-fs (mmcblk0p3): warning: mounting unchecked fs, running e2fsck is recommended
Apr 17 15:03:54 emonbase kernel: [   15.149158] EXT4-fs (mmcblk0p3): mounted filesystem without journal. Opts: (null)
Apr 17 15:03:54 emonbase kernel: [   17.409059] ip_tables: (C) 2000-2006 Netfilter Core Team
Apr 17 15:03:54 emonbase kernel: [   17.478436] nf_conntrack version 0.5.0 (2903 buckets, 11612 max)
Apr 17 15:03:54 emonbase kernel: [   17.593784] ip6_tables: (C) 2000-2006 Netfilter Core Team
Apr 17 15:03:54 emonbase kernel: [   19.658973] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Apr 17 15:03:54 emonbase kernel: [   21.375349] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
Apr 17 15:03:54 emonbase ifplugd(eth0)[1551]: Program executed successfully.
Apr 17 15:03:56 emonbase kernel: [   25.646871] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to atta$
Apr 17 15:03:57 emonbase /usr/sbin/cron[1937]: (CRON) INFO (pidfile fd = 3)
Apr 17 15:03:57 emonbase /usr/sbin/cron[1939]: (CRON) STARTUP (fork ok)
Apr 17 15:03:57 emonbase /usr/sbin/cron[1939]: (CRON) INFO (Running @reboot jobs)
Apr 17 15:04:02 emonbase kernel: [   31.774338] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:7c:4c:a5:24:f8:dc:08:00:46:00:00:24:00:00:40:00:01:02:44:29 SRC=192.168.$
Apr 17 15:04:08 emonbase mysqld_safe: Starting mysqld daemon with databases from /home/pi/data/mysql
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a futu$
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be remove$
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [Note] Plugin 'FEDERATED' is disabled.
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: The InnoDB memory heap is disabled
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Compressed tables use zlib 1.2.7
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Using Linux native AIO
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Initializing buffer pool, size = 128.0M
Apr 17 15:04:09 emonbase mysqld: InnoDB: mmap(135987200 bytes) failed; errno 12
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Completed initialization of buffer pool
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Fatal error: cannot allocate memory for the buffer pool
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [ERROR] Plugin 'InnoDB' init function returned error.
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [ERROR] Unknown/unsupported storage engine: InnoDB
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [ERROR] Aborting
Apr 17 15:04:09 emonbase mysqld:
Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 [Note] /usr/sbin/mysqld: Shutdown complete
Apr 17 15:04:09 emonbase mysqld:
Apr 17 15:04:09 emonbase ntpd[2517]: ntpd 4.2.6p5@1.2349-o Mon Feb  9 03:34:42 UTC 2015 (1)
Apr 17 15:04:09 emonbase ntpd[2518]: proto: precision = 1.000 usec
Apr 17 15:04:09 emonbase ntpd[2518]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123

 

pb66's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

Sorry I'm not seeing anything obvious I recognize so if it were me I would br googling a few of those "mysqld" messages, maybe someone more knowledgeable can jump in with a suggestion ??

Bill Thomson's picture

Re: Raspberry PI Emoncms - Starting from scratch, Which method

Apr 17 15:04:09 emonbase mysqld: 150417 15:04:09 InnoDB: Fatal error: cannot allocate memory for the buffer pool

MySQL's default storage engine (InnoDB) is failing to initialize because of a memory allocation issue.

Setting innodb_use_sys_malloc to 0 enables MySQL to use its internal memory manager vice the OS manager.

Try adding: innodb_use_sys_malloc = 0 to /etc/my.cnf and restarting

 

If that doesn't work, add:
ignore-builtin-innodb

and

default-storage-engine = myisam

under

[mysqld]

in /etc/my.cnf

 

To fix errors on the boot (FAT) partition, you'll need to install dosfstools.

sudo apt-get update; sudo apt-get install dosfstools

then run:

sudo dosfsck -avw /dev/mmcblk0p1

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.