Go to advanced search

by Killertechno
Wed Feb 13, 2019 9:12 am
Forum: C/C++
Topic: [C] compatibility data types 32-64 bit?
Replies: 17
Views: 295

[C] compatibility data types 32-64 bit?

Hi to all, I have little doubt about compatibility between 32/64 bit OSs..... C data types size in bytes (e.g. for long) could be different, so I should tell compiler to compile in 32bit even if running on 64bit OS. If I've correctly understood, I just need to use "-m32" option in compiler string. O...
by Killertechno
Mon Jan 21, 2019 4:56 pm
Forum: C/C++
Topic: License key for C program?
Replies: 1
Views: 248

License key for C program?

Hi to all,
I'm writing software in C for specific Raspberry HAT: I want software could work only with specific HAT (with specific unique hardware ID).
Is this possible in C?
I have no idea about doing this, it's first time...
Thanks.
by Killertechno
Fri Dec 28, 2018 11:57 pm
Forum: C/C++
Topic: Little doubt on floating point precision
Replies: 7
Views: 498

Re: Little doubt on floating point precision

This not working: #include <stdio.h> #define hpf_filterorder 1 // ordine del filtro passa-alto per la rimozione dell'offset #define max_components 1 #define filter_order hpf_filterorder struct FilterBuffer { float input[filter_order+1]; float output[filter_order+1]; }; struct FilterBuffer FilterValu...
by Killertechno
Fri Dec 28, 2018 11:27 pm
Forum: C/C++
Topic: Little doubt on floating point precision
Replies: 7
Views: 498

Re: Little doubt on floating point precision

Sorry, taking a look to Python code "a" is not an integer as I supposed but iy says <type 'numpy.ndarray'>.
by Killertechno
Fri Dec 28, 2018 11:14 pm
Forum: C/C++
Topic: Little doubt on floating point precision
Replies: 7
Views: 498

Re: Little doubt on floating point precision

Here another example code: #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <dirent.h> #include <libgen.h> #include <math.h> #include <netinet/in.h> #include <sys/stat.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <s...
by Killertechno
Fri Dec 28, 2018 9:54 pm
Forum: C/C++
Topic: Little doubt on floating point precision
Replies: 7
Views: 498

Little doubt on floating point precision

Hi to all, I'm porting Python code to C code and I have alittle doubt. On my Python code I have: a = 18781 b = 0.997649 c = a*b print("%f" % (c)) result is 18736.851729 while in C code: int a = 18781; float b = 0.997649; double c = 0.997649; printf("%f\r\n", a*b); printf("%f\r\n", (float)(a)*b); pri...
by Killertechno
Fri Dec 21, 2018 7:18 pm
Forum: Other programming languages
Topic: [newbie] How install npm?
Replies: 2
Views: 816

[newbie] How install npm?

Hi to all, I know this cuold be a stupid question but I'm totally noob about this.... I have a server I can supply seismic data (Raspberry at 127.0.0.1), I want display realtime data on webpage following this example: http://www.seis.sc.edu/~crotwell/seisplotjs_demo/realtime/seedlink.html My target ...
by Killertechno
Thu Dec 20, 2018 11:25 am
Forum: C/C++
Topic: math problems in C
Replies: 12
Views: 2570

Re: math problems in C

Hi to all, not same trouble but I'm porting program from python too.... #define Gauss_sigma 0.025 #define Gauss_wiLength 2.0 #define SPS 100 double dT; unsigned int Gauss_smplLen; int main (void) { dT = 1.0/(double)SPS; // quanto di campionamento printf("Lunghezza finestra filtro %f campioni (double...
by Killertechno
Sun Dec 09, 2018 6:34 pm
Forum: Beginners
Topic: How to set time and date in boot time
Replies: 25
Views: 4180

Re: How to set time and date in boot time

Hi guys, may I ask where raspberry does save date at poweroff? I mean, where does raspberry read date after boot? I'm using latest raspbian, I set /etc/fake-hwclock.data file with dummy time (1th Jan 2000) and set it with read-only permissions. At boot I get time updated to 2016 without RTC and no n...
by Killertechno
Mon Dec 03, 2018 5:50 pm
Forum: Python
Topic: Run external command and get output
Replies: 1
Views: 438

Run external command and get output

Hi to all, I am a noob in python and I need to run shell scripts. I've found some examples: #!/usr/bin/python import subprocess, sys cmd = "sudo /etc/init.d/ntp stop" p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) ## Talk with date command i.e. read data from stdout and stderr. Store ...
by Killertechno
Mon Dec 03, 2018 3:30 pm
Forum: Python
Topic: Periodically update DS3231 RTC with NTP
Replies: 11
Views: 843

Re: Periodically update DS3231 RTC with NTP

Hi to all, I found this thread so I try to resume my old project due I'm confused about ntp sync and RTC on Raspberry pi..... I'm using one of latest Raspberry images (April or August 2018, I don't remember). In my application I use DS3231 (I need its PPS for external hardware) and I need to detect ...
by Killertechno
Fri Nov 30, 2018 8:55 am
Forum: Compute Module
Topic: WF111 wifi module on CM3
Replies: 3
Views: 1913

Re: WF111 wifi module on CM3

Hi, did you solve issues?
by Killertechno
Fri Nov 23, 2018 6:34 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

What do you mean?
by Killertechno
Fri Nov 23, 2018 8:40 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

All ethernet ports (eth0, eth2) goes to two router: same dhcp server configuration, just different networks. Working. Only ENC20J60 module not working at all.
by Killertechno
Thu Nov 22, 2018 9:49 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

I'm not used to connect devices randomly....

eth2 is usb to lan converter.
I already changed ethernet cable, tested straight and cross, changed router port.
dhcpconf.d is the default of Debian image (2018-april).
by Killertechno
Thu Nov 22, 2018 4:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

Here picture of board.
by Killertechno
Thu Nov 22, 2018 3:54 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

Did you enable SPI with 'sudo raspi-config'? Obviously, I followed guides on connecting ENC28J60 on Raspberry forum. Can you show us how you wired the module? Are you sure you used the correct pins (using Broadcom numbering, not physical numbering)? Can you see eth1 with 'ifconfig'? Can you see the...
by Killertechno
Thu Nov 22, 2018 10:41 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ENC28J60 SPI Ethernet
Replies: 33
Views: 47741

Re: ENC28J60 SPI Ethernet

Hi to all, I write here avoiding open new thread. I bought ENC28J60 module from web, I connected wires (I left INT on GPIO25) and I added dtoverlay=enc28j60 on config.txt. I correctly find new eth1 interface running ifconfig (missing interface if enc28j60 module unconnected). I use eth0 on dhcp (ori...
by Killertechno
Tue Nov 20, 2018 9:42 am
Forum: Compute Module
Topic: Doubt on remapping pins
Replies: 2
Views: 2212

Re: Doubt on remapping pins

Ok, understood, thanks.
by Killertechno
Sat Nov 17, 2018 10:18 pm
Forum: Compute Module
Topic: Doubt on remapping pins
Replies: 2
Views: 2212

Doubt on remapping pins

Hi to all, mayube it would be a stupid question but I've never seen it before: on CM I can remap pins and get alternate pinfunction writing on config.txt file.
Well.
But... about previous versions of Pi?
Is it possible do the same on Pi 2? (get second UART or remap peripherals)
Thanks.
by Killertechno
Mon Sep 24, 2018 3:58 pm
Forum: Python
Topic: Graph real-time streaming data on webpage
Replies: 5
Views: 977

Re: Graph real-time streaming data on webpage

But it looks a simple graph updated when pressing button... or am I wrong?
by Killertechno
Mon Sep 24, 2018 2:37 pm
Forum: Python
Topic: Graph real-time streaming data on webpage
Replies: 5
Views: 977

Graph real-time streaming data on webpage

Hi to all, I'm newbie in python and webpages. My target is webpage to show realtime data such this example: https://github.com/plotly/Streaming-Demos#graphing-real-time-sensor-data I'm going to read realtime sensor data (50 or 100 samples/second), to be shown in 1/2 (or more) seconds refresh interva...
by Killertechno
Fri Sep 21, 2018 4:23 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Interfacing to MiniPCI-e USB devices?
Replies: 0
Views: 260

Interfacing to MiniPCI-e USB devices?

Hi to all, some devices are build in MiniPCI-e form factor (such Quectel UC20 modem): there are USB and UART pins for interfacing, SIM pins and power supply pins present on MiniPCU-e pinout. So I suppose (just about USB) I can connect USB terminals to USB connector of Raspberry (don't take care abou...
by Killertechno
Fri Sep 21, 2018 2:07 pm
Forum: Other projects
Topic: Reusing/Interfacing a Mini PCIe wifi Card
Replies: 3
Views: 5582

Re: Reusing/Interfacing a Mini PCIe wifi Card

Hi guys, avoiding to open similar thread.... I haven't MiniPci-e card available for tests, obviously I don't mean to create a full MiniPci-e interface, but I've read there are reserved pins for USB on MiniPci-e interface (available working USB depends either from host and/or MiniPci-e board) so I su...
by Killertechno
Mon Aug 20, 2018 8:12 pm
Forum: Advanced users
Topic: [RTC] DS3231 clock calibration (doubts and trouble)
Replies: 4
Views: 488

Re: [RTC] DS3231 clock calibration (doubts and trouble)

Paul Hutch wrote: I'd be suspicious that it will not actually meet the full set of specifications like a brand new chip will.
It meets. 1 ppm is within specifications, but regardless temperature.
I just suggested to trim DS3231 depending temperature to increase accuracy.

Go to advanced search