完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用PSoC 4 BLE先锋套件。我有一个LED闪烁控制CyScript(使用Android),每当他们运行,他们断开CyScript应用程序本身在30秒后的所有时间。我搜索了这个问题,发现我需要从描述符uuID中分离出特征uuID。我试过了,但错误还是来了。有人知道如何解决这个问题吗?
以上来自于百度翻译 以下为原文 I am using a PSOC 4 BLE pioneer kit. I have one LED blinking controlled by CySmart (using an android), and whenever they are running they disconnect from the CySmart App itself after 30 seconds all the time. I searched up this problem and found out that I need to separate the Characteristic UUID from the Descriptor UUID. I tried this, but the error still came. Does anyone know how to fix this problem? |
|
相关推荐
21个回答
|
|
如果你有一个计时器,告诉它在30秒后断开;
连接是超时:这将导致不一致的定时IMO,所以它应该是容易验证的。 手机在不活动/ 30秒后可能断开,以防止浪费的电力/通信。 如果没有看到你的项目,它将主要是猜测;如果你可以,把你的项目的最小zip附加到线程,然后我们都可以看一看项目/设置。 以上来自于百度翻译 以下为原文 If you have a timer of some sort telling it to disconnect after 30 seconds; The connection is timing out: This would cause inconsistent timing imo, so it should be easily verifiable. The phone may be disconnecting after inactivity/ 30 seconds to prevent wasted power/communications. Without seeing your project it would be mostly conjecture; If you can, attach a minimal zip of your project to the thread and then we can all take a look at the project/settings. |
|
|
|
该程序只在第一次运行时运行,您需要在定时器/中断函数/设置中运行以使它在每个连接和写入值上运行。如果我有时间的话,我会发布一个补丁。 以上来自于百度翻译 以下为原文 This program only works the first time it runs; You will need to play around with the timer/interrupt functions/settings to get it to run on each connect and write value. I'll post a fix if I have time later |
|
|
|
60user196 发表于 2018-11-20 13:25 这是程序的ZIP文件。 拉链 3.6兆字节 以上来自于百度翻译 以下为原文 Here is the zip file of the program.
|
|
|
|
计时器不工作,PWM LED只是停留在绿色,甚至在5秒之后。而且,红色的LED甚至根本不会出现,尽管它被称为ISRY-LwitxPUPSPSARSTTEX(Buffic Cwitter回调);我们需要连接计时器上的中断,以确保LED从绿色切换到红色吗? 以上来自于百度翻译 以下为原文 The timer is not working and the PWM LED is just staying on green, even after 5 seconds. Also, the red LED would not even appear at all though it is called in the isr_switch_pumps_StartEx(PumpSwitchCallback); line. Do we need to connect the interrupt on the timer to make sure that the LEDs switch from green to red? |
|
|
|
“连接监视”超时设置为10秒;可能由于丢失的保持活动包,监视超时在20秒后开始?(这是在BLE组件-gt;间隙设置-gt;外围优选连接参数-gt;“连接监视超时(MS)”。 基于函数的文档的措辞,在主调C中调用的EnnLPM函数不正确调用。尝试删除该行并查看是否在30秒后随机断开。 编辑:同样,你的项目看起来过时了。尝试更新PSoC创建者IDE,并将项目更新到最新版本 以上来自于百度翻译 以下为原文 The "Connection supervision" timeout is set to 10 seconds; Possibly, the supervision timeout is starting after 20 seconds due to a missed keep-alive packet? (This is under the BLE component->GAP Settings->Peripheral preferred connection parameters->"Connection supervision timeout (ms)" The EnterLPM function you are calling in main.c is being called incorrectly based on the wording of the documentation around the function. Try removing that line and see if the random disconnect after 30 seconds disappears. Edit: Also, your project looks to be outdated. Try updating your PSoC Creator IDE, and the project to the latest versions |
|
|
|
60user196 发表于 2018-11-20 14:05 在顶部设计中,定时器中断输出引脚应该连接到ISRI组件,这将导致ISR在定时器用完时中断。导致5秒的时间从绿色LED切换到红色LED。我不应该第一次把它连接好,明天早上当我回来工作的时候我会检查一下,但是我记得第一次连接到这个设备时就开始工作了,每次工作都只需要再多做一点工作。 基本上:计时器将由软件API调用启动,将运行5秒,触发中断引脚,导致ISR在5秒内开火,这将通过将LED改变为红色来处理中断。 以上来自于百度翻译 以下为原文 In the top design, the timer interrupt output pin should be wired to the isr_ component; This will cause the ISR to interrupt when the timer runs out. Leading to the 5 second time to switch from the Green LED to the Red LED. I must not have connected that properly the first time; I'll check tomorrow morning when I'm back at work, but I remember getting it working the first time you connect to the device, and getting it to work every time should only be a little more work. Essentially: The timer will get started by the software API call, will run 5 seconds, fire the interrupt pin, causing the ISR to fire after 5 seconds, which will handle the interrupt by changing the LED to RED. |
|
|
|
60user196 发表于 2018-11-20 14:19 谢谢你的信息。但是我试着改变/禁用连接监视超时,我删除了EnLPM,我更新了我的项目,但是程序在30秒后保持断开。有没有其他的修补程序或想法来确保程序不会像以前那样断开连接? 以上来自于百度翻译 以下为原文 Thanks for the information e.pratt. But I tried changing/disabling the connection supervision timeout, I deleted the EnterLPM, and I updated my project but the program keeps disconnecting after 30 seconds. Is there any other fixes or ideas to ensure that the program does not disconnect like before? |
|
|
|
60user196 发表于 2018-11-20 14:05 我已经把更新的项目附在这个帖子上,关于中断的修复没有被连接,只是我的错误。我已经把更新过的项目附加到了修复中。 我修复了它,使定时器在断开时复位,并且计时器正确地工作在中断中。 CoprSeld.CyWrk.CaseV02.Zip 966.3 K 以上来自于百度翻译 以下为原文 I've attached the updated project to this post with the fix on the interrupt not being connected Simply mistake on my part. I've attached the updated project with the fixes in it I fixed it so that the timer resets on disconnect, and the timer works correctly with the interrupting.
|
|
|
|
yuhe82 发表于 2018-11-20 14:33 100%确定,这不是PSoC项目在30秒后断开连接,您可以在调试中运行它,当它断开连接以查看状态变量是什么时停止。 但是,因为它是相当一贯的30年代,并且最有可能的罪犯在Culle项目被禁用,我怀疑电话在30s之后断开。你试过看CysApp应用程序,看看它是否被设置为30秒后断开? 以上来自于百度翻译 以下为原文 To be 100% sure it is not the PSoC project disconnecting after 30 seconds, you could run it in debug, and halt when it disconnects to see what the state variables are. But, since it is pretty consistently 30s, and the most likely culprits on the CYBLE project were disabled, I would suspect that the phone is disconnecting after 30s. Have you tried looking through the CySmart app to see if it is set to disconnect after 30s? |
|
|
|
yuhe82 发表于 2018-11-20 14:52 非常感谢普拉特!程序成功地从绿色切换到红色5秒!但是,我需要红色LED停止10秒后,程序将运行绿色5秒,红色10秒,它将完全停止之后。有了这个说法,我需要再为红色LED添加另一个定时器块10秒后停止吗? 以上来自于百度翻译 以下为原文 Thanks a lot Pratt! The program successfully switched from green to red in 5 seconds! However, I need the red LED to stop after 10 seconds so that the program would run green for 5 seconds, red for 10 seconds, and it will stop completely after that. With this being said, do I need to add another timer block for the red LED to stop after 10 seconds? |
|
|
|
60user196 发表于 2018-11-20 15:09 我尝试过CysApp应用程序,但没说30秒后就会断开。然后我试着调试程序,但没有成功。然而,我做了一个轻微的修改程序,而不是闪烁,它只是保持一个坚实的红色LED灯。由于某种原因,这个程序代替眨眼程序而工作。我附上了下面的程序。我所做的唯一改变就是去掉for循环、CyDelay和OFF(Re11x写(!)!WrReqPARAM-&G.HANDALVALION.Value.Val[1 ]);将这些添加到程序中会有问题吗? CoprSeld.CyWrk.CaseV02.Zip 2.7兆字节 以上来自于百度翻译 以下为原文 I tried checking through the CySmart App, but could nothing saying it will disconnect after 30 seconds. Then I tried Debugging the program but with no success. However, I have made a slight modification to the program where instead of blinking, it just stays a solid red LED light. For some reason, this program works instead of the blinking program. I have attached the program below. The only changes I made were getting rid of the for loop, the CyDelay, and OFF (LED1_Write(!wrReqParam->handleValPair.value.val[1]);). Could there be a problem in adding these to the program? |
|
|
|
60user196 发表于 2018-11-20 15:22 有两种不同的方法可以做到: 创建一个定时器,并使用该计时器计数两个颜色的5/10秒,或者如上面所建议的,添加一个新的硬件定时器。 如果你不需要其他的硬件数字块,最简单的方法就是添加一个新的定时器块。 否则,只需几行代码空间就可以重用第一个计时器来计时这两个选项。 (例如,计时器已经设置5秒,一旦它切换到红色LED,将周期设置为10秒并再次运行,或者使用计数器并在关闭红色LED之前再运行两次) 以上来自于百度翻译 以下为原文 There are two different approaches you could do: Create a single timer, and use that timer to count off the 5/10 seconds for both colors, or add a new hardware timer as you suggested above. If you don't need the hardware digital blocks for something else, the simplest would be to add a new timer block I think. Otherwise, it would only be a few lines of code space to reuse the first timer for timing both options. (e.g. the timer is already set for 5 seconds, once it switches to the RED LED, set the period to 10 seconds and run it again, or use a counter and run it twice more before turning off the RED LED) |
|
|
|
yuhe82 发表于 2018-11-20 15:30 另外,我试着在iOS设备(iPhone 5S)上做同样的事情,它在30秒后仍然断开。 以上来自于百度翻译 以下为原文 Additionally, I tried doing the same thing on my iOS device (iphone 5s) and it still disconnected after 30 seconds. |
|
|
|
yuhe82 发表于 2018-11-20 15:49 普拉特,我决定用两个定时器选项,但我在创建第二个定时器和执行程序时遇到了一些困难。当我添加另一个计时器,并构建程序时,它给了我这个错误:资源限制:超过数据路径单元的最大数目(max=4,需要=5)。有什么办法可以解决这个问题吗?我甚至可以添加一个以上的计时器吗? 以上来自于百度翻译 以下为原文 Pratt, I decided to go with the two-timer option but I was having some difficulty in creating a second timer and implementing it to the program. When I added another timer, and built the program, it gave me this error: Resource limit: Maximum number of Datapath Cells exceeded (max=4, needed=5). Is there any way of getting out of this problem? Can I even add more than one timer? |
|
|
|
yuhe82 发表于 2018-11-20 15:30 CyDelay-()函数将停止处理器直到达到所请求的时间延迟。这意味着如果在BLE事件发生时有延迟,并且不在BLE窗口/时间帧内处理CyByLePraceSeVScript()调用,那么祝福可能会崩溃。 以上来自于百度翻译 以下为原文 The cydelay() function will stall the processor until it reaches the time delay requested. This means that if you have a delay when a BLE event occurs, and don't handle it with the CyBLE_ProcessEvents() call within the BLE window/timeframe, then the BLESS will probably crash |
|
|
|
如果你设置PWM来完成LED的定时,它将异步地从程序中运行,并且你可以在必要时启用/禁用它,以防止闪烁时序所需的软件定时/延迟,并导致与BLE代码相关的问题。 IOS设备可能需要绑定/配对来连接/保持连接吗? 对于蓝牙来说,有很多iOS定时要求是非常严格的。 请参见这里:HTTPS://ExcRe.Apple 但让它与Android一起工作至少是一个进步。 很好的发现延迟和测试! 以上来自于百度翻译 以下为原文 If you setup the PWM to do the timing of the LED, it will run asynchronously from the program, and you can just enable/disable it when necessary to prevent software timing/delays from being needed for the blink timing, and causing issues with the BLE code. The iOS device might require bonding/pairing to connect/stay connected? There were alot of iOS timing requirements that were pretty stringent for Bluetooth. See here: https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf But getting it to work with the android is a step up at least Good job on finding the delay and testing it! |
|
|
|
yuhe82 发表于 2018-11-20 16:43 我评论了CysLyEnLyLPM(CybulyBelssiDeLoSt入睡),这句话并没有什么区别。 你认为有可能使用PSoC 4 BLE接口闪烁的LED而不发生这种断开连接的问题吗?有PSOC 4 BLE的商业产品吗? 任何帮助都是非常有必要的。谢谢。 以上来自于百度翻译 以下为原文 I commented the CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP); line and it made no difference. Do you think it is possible to have a blinking LED using PSOC 4 BLE Interface without having this disconnecting problem occur? Is there any commercial product with PSOC 4 BLE? Any help would be much obliged. Thanks. |
|
|
|
yuhe82 发表于 2018-11-20 16:55 你必须使用硬件定时器改变LED闪烁。无论是看门狗定时器,PWM定时,或定时器模块。 您可以将计时器对象放在顶部设计示意图页中,然后将其配置为在所需的时间间隔运行。 然后,你就设置了处理计时器的逻辑,以根据你的Delphi闪烁变量/设置来替换每个事件的LED状态。 以上来自于百度翻译 以下为原文 You would have to change the LED to blink using a hardware timer. Either a watchdog timer, a PWM timing, or a Timer module. You would put the timer object in the top-design-schematic page, and then configure it for running at the interval you want. Then, you set up the logic for handling the timer to alternate the LED state every event based on your LED_BLINK variables/settings. |
|
|
|
60user196 发表于 2018-11-20 17:10 嘿,E·普拉特, 好消息!我尝试使用PWM连接,程序在30秒后没有断开。然而,你知道如何使PWM功能在一定的时间停止,以便下一个LED PWM可以启动?(我使用两个PWM发光二极管。) 我将转换这个程序,使它能够控制两个泵,而不是LED,我正在测试它与LED,以确保它是否工作。 下面是ZIP文件,附带了我对程序的最新修改。谢谢你的帮助! CoprSeld.CyWrk.CaseV03.Zip 2.5兆字节 以上来自于百度翻译 以下为原文 Hey e.pratt, Good news! I tried using the PWM for the connection and the program did not disconnect after 30 seconds. However, do you know how to make the PWM function stop at a certain amount of time so that the next LED pwm can start? (I am using two PWM LEDs.) I will convert this program to be able to have it control two pumps instead of LEDs and I am testing it out with LEDs to make sure if it works. Below is the zip file attached with my latest modifications to the program. Thanks for the tremendous help! |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2106 浏览 1 评论
1853 浏览 1 评论
3672 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1788 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
573浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
426浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
439浏览 2评论
389浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
920浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 03:42 , Processed in 1.242925 second(s), Total 114, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号