• ProgrammingGo

    Hi,

    I am using several CC2650 STK and I wanted to use kafka (producer and consumer) for data stream processing. I was trying to integrate the producer and consumer in the app, but it seems to me that I need to use threads to use Producer and Consumer simultaneously in the same app to be able to sending data to kafka and listening for answers. I was trying to separately implement them (two different apps) and it worked, but bundle them together I need to use threads. My problem is that looking at the given Sensortag example a delegate is used, so creating to classes and use threading is not working. Do you know how I can get solve the problem?

    posted in Pythonista read more
  • ProgrammingGo

    Hi, I tried out to set up 16g range to the accelerometer, activating only accelerometer with range of 16g like the following: bytes([0b00111000, 0b00000011] and the to convert the raw data I used the formula stated in the wiki of TI: http://processors.wiki.ti.com/index.php/CC2650_SensorTag_User's_Guide#Movement_Sensor

    ---> v = (raw(data * 1.0) / (32768/16) for every axes and the output seems to be not right because in static position I get the following values for x, y, z: 1.9414, 0.0786, 0.225. Normally the first value(x) should be around 0.981. When I am changing the configuration to bytes([0b00111000, 0b00000010] which should be 8G range and use the following formula: v = (raw(data * 1.0) / (32768/8) then seems to be correct and in static position I have following values: 0.920 , 0.005, 0.200. Do you know what is the problem? I checked the formula and the settings but it should be right. The problem is well known, but not solved , See here: https://evothings.com/forum/viewtopic.php?t=1875

    https://github.com/sandeepmistry/node-sensortag/issues/62

    posted in Pythonista read more
  • ProgrammingGo

    @JonB yes you are right, the alternative is quite nice and there is this Serial number string, but when Iam reading it out it says N.A ---> not available and it seems to be the same for every sensor

    posted in Pythonista read more
  • ProgrammingGo

    @JonB , hi :). How do you mean making up my own uuid?

    posted in Pythonista read more
  • ProgrammingGo

    @ccc Hi , I looked for that and it seems to be that randomly it will make up a device uuid. But my target is that I want a fix uuid which I can use with all types of smartphones.
    See here what TI says: https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/277511/989118

    and here : https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/481652

    So does it mean I can choose all of the uuid types? But the difference is not clear between them?

    posted in Pythonista read more
  • ProgrammingGo

    Hi, yeah every iPhone is creating his own UUID for the sensortags. Thank you for the information.
    I saw that they are several UUID types there, does it matter which I use?

    posted in Pythonista read more
  • ProgrammingGo

    Hi , I have a short question regarding reading out the UUID of the sensortag via peripheral.uuid using the cb library
    I connected the sensortag with two different iphones and I saw that I have different uuid for the same sensortag. Why it is like this? The uuid should be the same when I connect to different Iphone, or did I understand it wrong?

    posted in Pythonista read more
  • ProgrammingGo

    @JonB the amount of data per sample rate is about 35 to 40 bytes. The duration is continuously that means the whole day measuring.

    I don't think it is a problem of the cb module, with 500ms sample rates it works pretty fine. I don't have any alternative to the cb module to allow multiple connections.

    By the way, you suggested me to use logging to write in files. How can I manage to write in 3 different files by using logging? - Each peripheral has is own file.

    By eliminating the str() you mean to use the binary file for writing the values: wb for opening the file and then file.write(value) ?

    posted in Pythonista read more
  • ProgrammingGo

    @ellie_ff1493 Hi okay I will give a try to collect it in an array an then write in the file. Do you think that the redirection to a file via logging could help?

    posted in Pythonista read more
  • ProgrammingGo

    @cvp You're welcome :)

    posted in Pythonista read more
  • ProgrammingGo

    @cvp Hi cvp, thank you for your message, it is not a problem, I appreciate your support. What I want to do is that I append new datasets to the file. So I have 3 peripherals, let's say P1,P2,P3. An each for each of that I will create a file called: P1.txt, P2.txt and P3.txt. So the incoming datasets should be added /appended to the appropriate file. And because every 10 ms I receive datasets from all 3 peripherals via BLE, I need to store it in the file but it is to fast and sometimes the file is empty or some values are missing. If I increase the sending interval to 500ms everything works fine. And yes what I am doing is that I reopen the file every time I have a new dataset.

    posted in Pythonista read more
  • ProgrammingGo

    @JonB oh, no I did not want to confuse you. No I meant that I am using logging.debug or logging.info only as a replacement for the print(.

    Did you mean to use the logging module to write data into files, instead of write? (you suggested me to use logging module. If yes, how is it gonna work with the logging module? - Do you mean maybe something like this? - redirecting directly to file with logging module --> where a logger is set up to write the output directly to the file, without open and close it every time (redirect it directly to the file with logging)

    posted in Pythonista read more
  • ProgrammingGo

    Hi okay also wb for writing binary, thank you. I will try to collect more data in a dictionary or list and then write it in the file instead of open the file for every incoming dataset.
    Regarding the how much data Iam writing it is the following: sensordata1,sensordata2, sensordata3, sensordata4, time ---> this is send via file.write(str(sensordata1) + "," + str(sensordata2) + "," + str(sensordata3) + "," + str(sensordata4) + "," + str(time)). What Iam doing is that I concatenate all the values and send it as a string. And everytime a new dataset is available I execute the above write method to write it to the file

    posted in Pythonista read more
  • ProgrammingGo

    Hi, I am doing exactly that one:

    while True:
        data = getData()
        with open(file,'wa') as f:
             f.write(data
    

    By the way, Iam using the logging module to avoid the print() because it saves some time as well.

    Because I read that writing in different file formats is different. Especially when you want to have fast writing operation using a txt.file is not the best solution

    posted in Pythonista read more
  • ProgrammingGo

    Hi thank you for the response, I am recording nonstop data, so it is getting really huge. Do you mean to collect the values in a kind of buffer and then do a big write? For example, collect 1000 datasets, write them in the file and overwrite it with the new one? But I would maybe get the problem that I am to slow clearing the buffer and write the new datasets there?

    posted in Pythonista read more
  • ProgrammingGo

    Hi,
    I am dealing with a huge amount of data which I need to store in a file. I know how I can write these in files and everything is working fine, but since I receive new sensor data every 10ms from 3 peripherals, I am not able to store all data because writing in a text file is too slow and I am losing data.
    It seems like that the file format plays an important role, and I found out that you can use HDF5 files which are quite compact and especially build for dealing with a lot of data. The problem is that in Pythonista it is not possible to use the import hdf and import pandas. Do you know an alternative file format for fast writing?

    posted in Pythonista read more
  • ProgrammingGo

    @JonB HI thank you so much, it checked the vibration button on the left of the iPhone and the mute singer is not active. volume is turned up. So it is still not working :(. It is an Iphone 5S, should not be a problem normally

    posted in Pythonista read more
  • ProgrammingGo

    Hi,

    normally it is quite simple to use the sound library and to play the integrated sound effects of the iPhone via the Pythonista module sound.
    I took as reference the following example in the following URL link text.

    I imported the sound library, and used the sound.play_effect('Beep'), but the sound is not reproduced.
    Did I understand something wrong?

    posted in Pythonista read more
  • ProgrammingGo

    @JonB yes I am able to set up a timestamp, you need to add the functionality to the firmware. So I am able to label all the sensor data with a timestamp. In which URL did you check up the API?

    posted in Pythonista read more
  • ProgrammingGo

    Hi thank you so much, I need a resolution to milliseconds.
    Want I want to do is receive the timestamp of the sensortags on the smartphone via Pythonista, configure it (synchronize) and set it back to the sensortags. After that sensortags receive it, the tags should send the values to smartphone.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!